WeBWorK Main Forum

webwork2 service does not start on reboot

webwork2 service does not start on reboot

by Andras Balogh -
Number of replies: 1
As the title says, the webwork2 service does not start on reboot, although it was enabled previously and the service files are there. I wonder if this is due to OS related settings.  Version 2.19 on Ubuntu 24.04.2 LTS.
 

Before reboot systemctl status webwork2: 
webwork2.service - webwork2
Loaded: loaded (/etc/systemd/system/webwork2.service; enabled; preset: enabled)
Active: active (running) since Sun 2025-05-04 11:39:50 CDT; 1 week 1 day ago
Process: 5883 ExecStart=hypnotoad /app/webwork/webwork2/bin/webwork2 (code=exited, status=0/SUCCESS)

After reboot systemctl status webwork2:
Unit webwork2.service could not be found.

Must reenable it after every reboot.

The content of the file is 
[Unit]
Description=webwork2
After=network.target
[Service]
Type=forking
#User=www-data
#Group=www-data
RuntimeDirectory=webwork2
WorkingDirectory=/app/webwork/webwork2
PIDFile=/run/webwork2/webwork2.pid
#Environment="MOJO_REVERSE_PROXY=1"
ExecStart=hypnotoad /app/webwork/webwork2/bin/webwork2
ExecReload=hypnotoad /app/webwork/webwork2/bin/webwork2
KillMode=process

[Install]
WantedBy=multi-user.target

----------

In reply to Andras Balogh

Re: webwork2 service does not start on reboot

by Glenn Rice -

What happens when you run "ls -l /etc/systemd/system/webwork2.service"?  That should show a link to /opt/webwork/webwork2/conf/webwork2.service.

What about when you run "ls /etc/systemd/system/multi-user.target.wants"?   That should also show a link to /opt/webwork/webwork2/conf/webwork2.service.

You should see both.  If either of those are shown, but not both, then delete the one that is shown, and run "sudo systemctl enable /opt/webwork/webwork2/conf/webwork2.service".  After running that command you should see both of the links above.

If that still does not fix the problem, then you might have a corrupt file system.  At least that is one reason I can think of that this might happen.