13

In systemd based systems, such as debian 8 and ubuntu 16.04, I have this issue whereby the machine will refuse to shut down if I forgot to stop my openvpn connection before sending the command to shut down.

enter image description here

The command I use to start my openvpn connection is:

sudo openvpn --config client.conf --script-security 2

Is there a way I can change the command so systemd knows that it's okay to terminate it more quickly when the system is shutting down? Perhaps the alternative is to change systemd's timeout period to be much shorter? I would rather avoid any type of aliasing of my poweroff, halt, reboot, and shutdown commands.

3 Answers 3

10

I have used systemd for 5 months. Sometimes I get this problem. To reduce the delay from the default value 90s (1min30s), it is in the /etc/systemd/system.conf file:

#DefaultTimeoutStartSec=90s
#DefaultTimeoutStopSec=90s

Uncomment these line and change to any value you want. This solution just reduce time you have to wait. You should check your virtualbox daemon.

Second solution is install watchdog and enable it. It works for many people but it not works for me.

P/s: If you want to force poweroff. Let have a look at systemctl manpage.

2
  • So there is no way to make the process automatically killable by systemd on shutdown, such as by backgrounding it or setting a priority or something? Jun 12, 2016 at 8:21
  • you should have a look at systemctl poweroff. Man page provides something interesting. It maybe discouragement.
    – thangdc94
    Jun 12, 2016 at 8:53
0

I stopped having this problem after I configured openvpn to run as a systemd unit.

I followed this section on the arch linux wiki: https://wiki.archlinux.org/index.php/OpenVPN#systemd_service_configuration

It was also necessary to make other programs that run as sudo - systemd units as well (like wpa_supplicant was for me).

It does require knowledge and practice to start/stop/read logs of systemd units, but it definitely paid off.

-1

" A start job running" is caused by etc/fstab having the wrong

Swap UUID (at least on my Ubuntu 16.04 Cinnamon)

  do "sudo blkid" in a terminal to get the correct UUID for swap ,

and then paste it into etc/fstab.

1
  • The problem is a STOP job, not a start job. Aug 21, 2016 at 1:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .