Skip to content

Commit

Permalink
Remove /run/network directory creation in codebase
Browse files Browse the repository at this point in the history
and /etc/network/run directory symlink.

We no longer need to worry about the existence of this directory.
The system handles the creation.
  • Loading branch information
Olivier BLIN committed Nov 13, 2023
1 parent 2f92e4c commit f7a3270
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
5 changes: 1 addition & 4 deletions etc/init.d/networking
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Raise network interfaces.
# Description: Prepare /run/network directory, ifstate file and raise network interfaces, or take them down.
# Description: Prepare ifstate file and raise network interfaces, or take them down.
### END INIT INFO

RUN_DIR="/run/network"
Expand Down Expand Up @@ -128,9 +128,6 @@ ifup_hotplug () {
ifupdown_init() {
# remove state file at boot
[ ! -e ${IFSTATE_LOCKFILE} ] && rm -f ${IFSTATE_FILE}
[ ! -e /run/network ] && mkdir -p /run/network &>/dev/null
[ ! -e /etc/network/run ] && \
ln -sf /run/network /etc/network/run &>/dev/null
}

case "$1" in
Expand Down
3 changes: 0 additions & 3 deletions ifupdown2/ifupdown/statemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ def init(self):
except Exception as e:
raise Exception("statemanager: unable to create required directory: %s" % str(e))

if not os.path.exists(self.state_rundir):
os.makedirs(self.state_rundir)

self.state_file = "%s/%s" % (self.state_dir, self.state_filename)

def _init_makedirs_state_dir(self):
Expand Down
4 changes: 0 additions & 4 deletions ifupdown2/sbin/start-networking
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ ifup_mgmt () {
ifupdown_init() {
# remove state file at boot
[ ! -e ${IFSTATE_LOCKFILE} ] && rm -f ${IFSTATE_FILE}

[ ! -e /run/network ] && mkdir -p /run/network &>/dev/null
[ ! -e /etc/network/run ] && \
ln -sf /run/network /etc/network/run &>/dev/null
}

case "$1" in
Expand Down

0 comments on commit f7a3270

Please sign in to comment.