Skip to content

Update systemd services to use ConditionHost= #117

Merged
merged 7 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,14 @@ mkdir -p "$DESTDIR$udev_helperdir"

install_exec make-automaps/make-automaps "$DESTDIR$usr_sbindir/make-automaps"
install_data misc_systemd_units/automount.service "$DESTDIR$systemdunitdir/automount.service"
install_data misc_systemd_units/dhcrelay.service "$DESTDIR$systemdunitdir/dhcrelay.service"
install_data misc_systemd_units/enable_overcommit_memory.service "$DESTDIR$systemdunitdir/enable_overcommit_memory.service"
install_data misc_systemd_units/gdm.service "$DESTDIR$systemdunitdir/gdm.service"
install_data misc_systemd_units/startup-tags.service "$DESTDIR$systemdunitdir/startup-tags.service"
install_data misc_systemd_units/unbound.service "$DESTDIR$systemdunitdir/unbound.service"
install_data misc_systemd_units/xaruba.service "$DESTDIR$systemdunitdir/xaruba.service"
install_data misc_systemd_units/yppasswd.service "$DESTDIR$systemdunitdir/yppasswd.service"
install_data misc_systemd_units/ypserv.service "$DESTDIR$systemdunitdir/ypserv.service"
install_exec mkmotd/mkmotd.pl "$DESTDIR$usr_sbindir/mkmotd.pl"
install_data mkmotd/motd.service "$DESTDIR$systemdunitdir/motd.service"
install_exec mxgrub/mxgrub "$DESTDIR$usr_sbindir/mxgrub"
Expand Down
18 changes: 18 additions & 0 deletions misc_systemd_units/dhcrelay.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]

Description=DHCP relay
Requires=network.target
After=network.target

ConditionHost=bka.molgen.mpg.de

[Service]

ExecStart=/usr/sbin/dhcrelay -4 -d dhcp.molgen.mpg.de
Restart=always
StandardOutput=syslog

[Install]

WantedBy=multi-user.target

4 changes: 1 addition & 3 deletions misc_systemd_units/named.service
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[Unit]
After=network.service gateway.service mxmount.service automount.service

Wants=startup-hostname.service
After=startup-hostname.service
Before=mxstartup-mxvip.service
ConditionPathExists=/node/startup-hostname/wtf
ConditionHost=wtf.molgen.mpg.de

[Service]
Type=forking
Expand Down
7 changes: 7 additions & 0 deletions misc_systemd_units/startup-tags.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Unit]

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/hostconfig --populate-node

14 changes: 14 additions & 0 deletions misc_systemd_units/xaruba.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
After=network.service gateway.service mxmount.service
Before=network.target

ConditionHost=macheteinfach.molgen.mpg.de

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/sbin/ip-nat start 141.14.27.49 443 172.19.109.10 4343 20 net04
ExecStop=/usr/sbin/ip-nat stop 141.14.27.49 443 172.19.109.10 4343 20 net04

[Install]
WantedBy=network.target
12 changes: 12 additions & 0 deletions misc_systemd_units/yppasswd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
After=network.service gateway.service mxmount.service automount.service

ConditionHost=wtf.molgen.mpg.de

[Service]
Type=forking
ExecStart=/package/nis/sbin/rpc.yppasswdd -D /package/nis/src -e chsh

[Install]
WantedBy=network.target

16 changes: 16 additions & 0 deletions misc_systemd_units/ypserv.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
After=network.service gateway.service mxmount.service automount.service
Before=network.target

ConditionHost=wtf.molgen.mpg.de

[Service]
Type=forking
Restart=always
ExecStartPre=-/sbin/ip addr add 141.14.31.96/20 dev net03
ExecStart=/package/nis/sbin/ypserv
ExecStopPost=-/sbin/ip addr del 141.14.31.96/20 dev net03

[Install]
WantedBy=network.target