* removed quotes around chroot command in usher * removed hwclock from Required-Start in checkfs * removed $local_fs from Required-Start in hostname * updated mountvirtfs to create /run/utmp * added 2 conditionals to readsvcs() in update-rc
35 lines
818 B
Bash
Executable File
35 lines
818 B
Bash
Executable File
#!/bin/sh
|
|
### BEGIN INIT INFO
|
|
# Provides: hostname
|
|
# Required-Start:
|
|
# Required-Stop:
|
|
# Should-Start:
|
|
# Should-Stop
|
|
# Default-Start: S
|
|
# Default-Stop:
|
|
# Short-Description: Set hostname to value in /etc/hostname
|
|
# Description: Set hostname to value in /etc/hostname if
|
|
# present, otherwise set hostname to localhost
|
|
# X-Required: true
|
|
### END INIT INFO
|
|
|
|
. /lib/lsb/init-functions
|
|
[ -r /etc/hostname ] && HOSTNAME=`cat /etc/hostname`
|
|
[ -z "$HOSTNAME" ] && HOSTNAME='localhost'
|
|
|
|
case "$1" in
|
|
start|restart)
|
|
log_init_msg "Setting hostname to $HOSTNAME"
|
|
hostname $HOSTNAME && log_success_msg || log_failure_msg
|
|
;;
|
|
status)
|
|
echo "Current hostname: $(hostname)"
|
|
;;
|
|
*)
|
|
echo "Usage: $0 [start|restart|status]"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|