diff options
author | Christian Poessinger <christian@poessinger.com> | 2017-11-02 16:58:39 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2017-11-02 17:12:51 +0100 |
commit | f7e60e7beb90b193aebd2edf43a5cbd7cc1b475d (patch) | |
tree | 5682cf36190430ab5a37ac29c23d102b9840dd91 | |
parent | 5333de74083111c23c7b8fb517d9924ba8afb9fd (diff) | |
download | vyatta-cfg-system-f7e60e7beb90b193aebd2edf43a5cbd7cc1b475d.tar.gz vyatta-cfg-system-f7e60e7beb90b193aebd2edf43a5cbd7cc1b475d.zip |
T437: Fixed system option "Ctrl-Alt-Delete action" broken
-rwxr-xr-x | debian/vyatta-cfg-system.postinst.in | 2 | ||||
-rw-r--r-- | templates/system/options/ctrl-alt-del-action/node.def | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/debian/vyatta-cfg-system.postinst.in b/debian/vyatta-cfg-system.postinst.in index 8888aa60..60ed8eeb 100755 --- a/debian/vyatta-cfg-system.postinst.in +++ b/debian/vyatta-cfg-system.postinst.in @@ -188,7 +188,7 @@ if [ -e /etc/default/mdadm ]; then fi # Disable reboot on ctrl-alt-delete -sed -i -e '/^ca/s/\/sbin\/shutdown .*$/\/bin\/echo "Ctrl\-Alt\-Del disabled."/' /etc/inittab +ln -sf /dev/null /lib/systemd/system/ctrl-alt-del.target # remove unnecessary ddclient script in /etc/ppp/ip-up.d/ # this logs unnecessary messages trying to start ddclient diff --git a/templates/system/options/ctrl-alt-del-action/node.def b/templates/system/options/ctrl-alt-del-action/node.def index 3bbf2a81..a853b151 100644 --- a/templates/system/options/ctrl-alt-del-action/node.def +++ b/templates/system/options/ctrl-alt-del-action/node.def @@ -12,15 +12,15 @@ syntax:expression: $VAR(@) in "ignore", "reboot", "poweroff"; "Value must be ign end: if [ $VAR(@) == "ignore" ]; then - sudo sh -c "sed -i -e 's/^ca.*/ca:12345:ctrlaltdel:/' \ - /etc/inittab" + sudo sh -c "ln -sf /dev/null \ + /lib/systemd/system/ctrl-alt-del.target" elif [ $VAR(@) == "reboot" ]; then - sudo sh -c "sed -i -e 's/^ca.*/ca:12345:ctrlaltdel:\/sbin\/reboot/' \ - /etc/inittab" + sudo sh -c "ln -sf /lib/systemd/system/reboot.target \ + /lib/systemd/system/ctrl-alt-del.target" elif [ $VAR(@) == "poweroff" ]; then - sudo sh -c "sed -i -e 's/^ca.*/ca:12345:ctrlaltdel:\/sbin\/shutdown -h now/' \ - /etc/inittab" + sudo sh -c "ln -sf /lib/systemd/system/poweroff.target \ + /lib/systemd/system/ctrl-alt-del.target" fi - # Reload /etc/inittab for change to take effect - sudo /sbin/init q + # Reload systemd daemon for change to take effect + sudo /bin/systemctl daemon-reload |