Skip to content

Instantly share code, notes, and snippets.

@jvsalo
Created January 25, 2017 11:26
Show Gist options
  • Save jvsalo/b12d0b14a00b2fd6223ae3fbf44115e5 to your computer and use it in GitHub Desktop.
Save jvsalo/b12d0b14a00b2fd6223ae3fbf44115e5 to your computer and use it in GitHub Desktop.
root@saana:/home/jvsalo# systemctl cat ifup@
# /lib/systemd/system/ifup@.service
[Unit]
Description=ifup for %I
After=local-fs.target network-pre.target apparmor.service
Before=network.target
BindsTo=sys-subsystem-net-devices-%i.device
DefaultDependencies=no
IgnoreOnIsolate=yes
[Service]
# avoid stopping on shutdown via stopping system-ifup.slice
Slice=system.slice
ExecStart=/bin/sh -ec 'ifup --allow=hotplug %I; ifup --allow=auto %I; \
if ifquery %I >/dev/null; then ifquery --state %I >/dev/null; fi'
ExecStop=/sbin/ifdown %I
RemainAfterExit=true
TimeoutStartSec=5min
# /etc/systemd/system/ifup@.service.d/override.conf
[Service]
ExecStart=
ExecStart=/bin/sh -ec 'ifup --verbose --allow=hotplug %I; ifup --allow=auto %I; \
if ifquery %I >/dev/null; then ifquery --state %I >/dev/null; fi'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment