forked from FredHutch/proxmox-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proxhostname.conf
37 lines (29 loc) · 1.02 KB
/
proxhostname.conf
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
description "Proxmox Hostname"
author "dirkpetersen"
start on (filesystem and net-device-up IFACE=eth0)
# We cannot use "stop on runlevel [016]" because from that point on we
# have only 10 seconds until the system shuts down completely.
stop on starting rc RUNLEVEL=[016]
# Time to wait before sending SIGKILL to the daemon and
# pre-stop script
kill timeout 300
expect stop
env PATH=/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
script
# Redirect stdout and stderr into the system log
DIR=$(mktemp -d)
mkfifo "$DIR/LOG_FIFO"
logger -t ContIP -p local0.info < "$DIR/LOG_FIFO" &
exec > "$DIR/LOG_FIFO"
exec 2>&1
rm -rf "$DIR"
# set the local ip address once and reboot
/root/bin/proxhostname.py
## these are not required any more, handled by proxhostname.py
#echo manual > /etc/init/proxhostname.override
#dhclient -r; dhclient
end script
pre-stop script
echo "content of /etc/network/interfaces:"
cat /etc/network/interfaces
end script