/lib/systemd/system/novaboot-power@.service
/usr/sbin/novaboot-power
/usr/bin/novaboot-shell
-/usr/lib/systemd/user/novaboot-power-off.service
+/usr/lib/systemd/user/novaboot-delayed-power-off.service
/usr/lib/sysusers.d/novaboot-server.conf
/usr/sbin/adduser-novaboot
/usr/share/man/man1/novaboot-shell.1
install -D -m 644 -t $(DESTDIR)/lib/systemd/system systemd/novaboot-power-off@.service
install -D -m 644 -t $(DESTDIR)/lib/systemd/system systemd/novaboot-power-off@.timer
install -D -m 644 -t $(DESTDIR)/lib/systemd/system systemd/novaboot-power@.service
- install -D -m 644 -t $(DESTDIR)/usr/lib/systemd/user systemd/novaboot-power-off.service
+ install -D -m 644 -t $(DESTDIR)/usr/lib/systemd/user systemd/novaboot-delayed-power-off.service
install -D -m 440 systemd/sudoers.novaboot-server $(DESTDIR)/etc/sudoers.d/novaboot-server
install -D -m 755 -t $(DESTDIR)$(PREFIX)/sbin systemd/novaboot-power
if [ -d /run/systemd/system ]; then
cat <<EOF
-To enable automatic delayed power-off run 'systemctl --user enable novaboot-power-off'
+To enable automatic delayed power-off run 'systemctl --user enable novaboot-delayed-power-off'
as the created user (e.g. via shell subcommand)
EOF
# TODO: Add a way to run in automatically from here (allow shell
#subcommand to accept command lines)
- #systemctl --user enable novaboot-power-off
+ #systemctl --user enable novaboot-delayed-power-off
fi
*) die "Unexpected power parameter";;
esac
- if [ "$PPID" -ne 1 ] && systemctl --user is-enabled novaboot-power-off.service; then
+ if [ "$PPID" -ne 1 ] && systemctl --user is-enabled novaboot-delayed-power-off.service; then
sudo novaboot-power "$1"
else
eval "$cmd"
case "$1" in
on)
- exec systemctl start "novaboot-power@${SUDO_USER}.service";;
+ systemctl stop "novaboot-power-off@${SUDO_USER}.timer"
+ systemctl start "novaboot-power@${SUDO_USER}.service"
+ ;;
off)
- exec systemctl stop "novaboot-power@${SUDO_USER}.service";;
+ systemctl stop "novaboot-power@${SUDO_USER}.service"
+ ;;
delayed-off)
systemctl start "novaboot-power-off@${SUDO_USER}.timer"
# || systemd-run --on-active="$2" --unit="novaboot-power-off@${SUDO_USER}.target"
[Service]
Type=oneshot
RemainAfterExit=true
-ExecStartPre=systemctl stop novaboot-power-off@%i.timer
ExecStart=/usr/bin/novaboot-shell on
ExecStop=/usr/bin/novaboot-shell off
User=%i