Hi,
What is the purpose of the RUN_DIR variable in a shell script?
The first line of the script is
#!/bin/sh -e
Regards,
Frederiek
What is the purpose of the RUN_DIR variable in a shell script?
Head_on_a_Stick wrote:Do I get a prize for guessing that this is in /etc/init.d/networking?
empty@E485 ~ % grep RUN_DIR -R /etc/init.d
/etc/init.d/networking:RUN_DIR="/run/network"
/etc/init.d/networking:IFSTATE="$RUN_DIR/ifstate"
/etc/init.d/networking:STATEDIR="$RUN_DIR/state"
/etc/init.d/networking: if [ ! -d "$RUN_DIR" ] ; then
/etc/init.d/networking: if ! mkdir -p "$RUN_DIR" ; then
/etc/init.d/networking: log_failure_msg "can't create $RUN_DIR"
/etc/init.d/networking: if ! chown root:netdev "$RUN_DIR" ; then
/etc/init.d/networking: log_warning_msg "can't chown $RUN_DIR"
empty@E485 ~ %
Head_on_a_Stick wrote:^ You are too kind sir. And anyway:
- Code: Select all
empty@E485 ~ % grep RUN_DIR -R /etc/init.d
/etc/init.d/networking:RUN_DIR="/run/network"
/etc/init.d/networking:IFSTATE="$RUN_DIR/ifstate"
/etc/init.d/networking:STATEDIR="$RUN_DIR/state"
/etc/init.d/networking: if [ ! -d "$RUN_DIR" ] ; then
/etc/init.d/networking: if ! mkdir -p "$RUN_DIR" ; then
/etc/init.d/networking: log_failure_msg "can't create $RUN_DIR"
/etc/init.d/networking: if ! chown root:netdev "$RUN_DIR" ; then
/etc/init.d/networking: log_warning_msg "can't chown $RUN_DIR"
empty@E485 ~ %
I cheated
frederiek wrote:The first line of the script is
- Code: Select all
#!/bin/sh -e
#!/usr/bin/env bash
or
#!/usr/bin/env python3
Head_on_a_Stick wrote:Do I get a prize for guessing that this is in /etc/init.d/networking?![]()
Head_on_a_Stick wrote: But seriously, the more information that is included in the question the better the replies will be. See also http://catb.org/~esr/faqs/smart-questions.html
Head_on_a_Stick wrote: In the case of the networking init script $RUN_DIR defines the directory in /run that is used by the script to keep track of the state of the service. This hack is needed because sysvinit is an antiquated pile of crap that doesn't offer true process supervision.
neuraleskimo wrote:frederiek wrote:The first line of the script is
- Code: Select all
#!/bin/sh -e
I see this is your first post. Welcome!
neuraleskimo wrote:Posting the first line of the script isn't very informative because all scripts start roughly like that. That line is called the shebang or hashbang. Googling for either term will get you to a good explanation. A variation on that line is often:
- Code: Select all
#!/usr/bin/env bash
or
#!/usr/bin/env python3
frederiek wrote:Hi,
What is the purpose of the RUN_DIR variable in a shell script?
The first line of the script is
#!/bin/sh -e
Regards,
Frederiek
sysvinit is an antiquated pile of crap that doesn't offer true process supervision
Head_on_a_Stick wrote:In the case of the networking init script $RUN_DIR defines the directory in /run that is used by the script to keep track of the state of the service. This hack is needed because sysvinit is an antiquated pile of crap that doesn't offer true process supervision.
LE_746F6D617A7A69 wrote:systemd is even much worse crap
LE_746F6D617A7A69 wrote:I'm still trying to discover what have actually happened, but since systemd sources are ~2000 times bigger than sysvinit, it's hard to find the bug ...
C.A.R. Hoare wrote:There are two ways of constructing a software design: one way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.
LE_746F6D617A7A69 wrote:Systemd is just more "modern" pile of crap.
Bloom wrote:Then run Devuan. That's a fork of Debian that uses sysvinit instead of systemd.
Users browsing this forum: No registered users and 2 guests