File: 0wait

package info (click to toggle)
systemd-cron 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 636 kB
  • sloc: cpp: 2,599; sh: 962; makefile: 239; ansic: 133
file content (50 lines) | stat: -rwxr-xr-x 1,169 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# wait for local apt-cacher-ng proxy to come online
# before starting unattended-upgrades
# (that may well never happen before shutdown,
# but can happen later on the same day)
#
# /etc/cron.daily/0wait
rollback()
{
	echo "0wait aborted"
	touch -t 201401010000 /var/lib/systemd/timers/stamp-cron-daily.timer
	sleep 1
        killall run-parts
        exit 0
}

trap "rollback" TERM INT QUIT HUP

while true
do
	ping -qc 1 antec > /dev/null && exit 0
	sleep 300
done

# there should be a more systemd-ish way to do this
#
#systemd
#  |-atd -f
#  |-dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
#  |-fancontrol /usr/sbin/fancontrol
#  |   `-sleep 60
#  |-kdm -nodaemon
#  |   |-Xorg :0 vt7 -br -nolisten tcp -auth /var/run/xauth/A:0-86s7nb
#  |   `-kdm
#  |       `-kdm_greet
#  |           `-{QProcessManager}
#  |-nullmailer-send
#  |-run-parts --report /etc/cron.daily
#  |   `-0wait /etc/cron.daily/0wait
#  |       `-sleep 300
#  |-sshd
#  |   `-sshd
#  |       `-su -
#  |           `-bash
#  |               `-pstree -a
#  |-systemd --user
#  |   `-(sd-pam)
#  |-systemd-journal
#  |-systemd-logind
#  `-systemd-udevd