linux init 요약
created : Sun, 31 Jul 2022 22:13:30 +0900
modified : Sun, 31 Jul 2022 22:17:08 +0900
#!/bin/bash
### BEGIN INIT INFO
# Provides: startup.sh
# Required-Start: $reboot
# Required-Stop: $reboot
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Server init script
### END INIT INFO
case "$1" in
start)
# run as a specific user
sudo -u <username> /foo/bar
# TODO Something..
;;
*)
echo "Usage: $0 (start)"
;;
esac
exit 0
chmod 755 startup.sh
update-rc.d startup.sh defaults
update-rc.d -f startup.sh remove