Page 1 of 1

persistant systemd exit 2 for webui daemon

Posted: Wed Oct 09, 2024 9:49 pm
by T3chnic0l0r
Hello Everyone

I have complied/installed deluge on my computer form some time now, and while it briefly worked, it now will not start the webui deamon. any attempt to do so will result in the following errors from systemd.

Code: Select all

deluge-web[34705]: deluge-web: error: unrecognized arguments:
systemd[1]: deluge-web.service: Main process exited, code=exited, status=2/INVALIDARGUMENT>
systemd[1]: deluge-web.service: Failed with result 'exit-code'.]]
this happens regardless of what options are passed to the daemon, blank space is used as an example but so far every option I've tried has failed with the same exit code.

the deluge webui service looks like this, its the one generated automatically by portage on a fresh installation

Code: Select all

[[Service]
User=deluge
Group=deluge
Environment="DELUGE_WEB_HOME=/var/lib/deluge" "DELUGE_WEB_OPTS= "]
as for potential errors, i have ruled out any issues with the config, as deluge has all the relevant files and is configured as Gentoo requires it to be. all config files are owned by the deluge user, and there is no deluge config in the systems home user or in other directory to my knowledge. any help that could be given would be greatly appreciated.

Re: persistant systemd exit 2 for webui daemon

Posted: Thu Oct 10, 2024 11:18 am
by mhertz
I'm not in the know with gento myself, but that service is wrong - check official deluge docs for proper service: https://deluge.readthedocs.io/en/latest ... rvice.html

You have extra brackets as first and last char which isn't allowed, and here would have an ExecStart line, unless you have an drop-in override that adds it, in /etc/systemd/system/deluged.service.d/foo.conf. Check service and possible drop-ins through 'systemctl cat deluged'.

Re: persistant systemd exit 2 for webui daemon

Posted: Thu Oct 10, 2024 4:44 pm
by T3chnic0l0r
so i attempted to use the proper service and wound up with this error rather then the old one

Code: Select all

systemd[1]: deluge-web.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
systemd[1]: deluge-web.service: Failed with result 'exit-code'
systemd[1]: deluge-web.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.
this is also an issue i ran into with the main deluge daemon, but i was able to work around it by using parts of the gentoo provided config file.

removing the apparently redundant exec start line leads to this more impenetrable error, ive attached the whole error message rather then just the exit code in case i have missed something

Code: Select all

× deluge-web.service - Deluge Bittorrent Client Web Interface
     Loaded: loaded (/usr/lib/systemd/system/deluge-web.service; enabled; preset: disabled)
    Drop-In: /etc/systemd/system/deluge-web.service.d
             └─00gentoo.conf
     Active: failed (Result: exit-code) since Thu 2024-10-10 12:36:38 EDT; 3s ago
   Duration: 160ms
       Docs: man:deluge-web
             man:deluge-web
    Process: 21428 ExecStart=/usr/bin/deluge-web -d -c ${DELUGE_WEB_HOME} ${DELUGE_WEB_OPTS} (code=exited, status=2)
   Main PID: 21428 (code=exited, status=2)
        CPU: 159ms

systemd[1]: deluge-web.service: Scheduled restart job, restart counter is at 5.
systemd[1]: deluge-web.service: Start request repeated too quickly.
systemd[1]: deluge-web.service: Failed with result 'exit-code'.
systemd[1]: Failed to start Deluge Bittorrent Client Web Interface.

the extra brackets where a formatting error putting it into the editor box, i had a hard time working out how the code tags worked.

Re: persistant systemd exit 2 for webui daemon

Posted: Fri Oct 11, 2024 6:54 am
by mhertz
Kindly post result of:

Code: Select all

sudo systemctl cat deluged.service
sudo systemctl cat deluge-web.service 

Re: persistant systemd exit 2 for webui daemon

Posted: Fri Oct 11, 2024 2:17 pm
by T3chnic0l0r
deluged service

Code: Select all

# /usr/lib/systemd/system/deluged.service
[Unit]
Description=Deluge BitTorrent client
Documentation=man:deluged
After=network.target local-fs.target
Wants=local-fs.target

[Service]
ExecStart=/usr/bin/deluged -d -c ${DELUGED_HOME} ${DELUGED_OPTS}

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/deluged.service.d/00gentoo.conf
[Unit]
Description=Deluge Bittorrent Client Daemon
Documentation=man:deluged
After=network-online.target

[Service]
Type=simple
User=deluge
Group=deluge
Restart=on-failure
# Time to wait before forcefully stopped.
TimeoutStopSec=300
UMask=000
Environment="DELUGED_HOME=/var/lib/deluge" "DELUGED_OPTS=-p 58846"
deluge web service

Code: Select all

[Unit]
Description=Deluge WebUI
Documentation=man:deluge-web
After=deluged.service

[Service]
ExecStart=/usr/bin/deluge-web -d -c ${DELUGE_WEB_HOME} ${DELUGE_WEB_OPTS}

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/deluge-web.service.d/00gentoo.conf
[Unit]
Description=Deluge Bittorrent Client Web Interface
Documentation=man:deluge-web
After=deluged.service
Wants=deluged.service

[Service]
Type=simple
UMask=027

#ExecStart=/usr/bin/deluge-web 
Restart=on-failure
[Install]
WantedBy=multi-user.target

Re: persistant systemd exit 2 for webui daemon

Posted: Mon Oct 14, 2024 12:47 pm
by mhertz
I apologize, asking you for info and then bailing, didn't mean to do that, sorry buddy.

I see the issue, you have undefined vars referenced in deluge-web.service. For the way you do it, then add extra few lines under [Service] section of your '/etc/systemd/system/deluge-web.service.d/00gentoo.conf' e.g.:

Code: Select all

Environment="DELUGE_WEB_HOME=/var/lib/deluge" "DELUGE_WEB_OPTS=-p 8112"
User=deluge
Group=deluge
(First line is the fix, and second two for not running as root).

Run 'sudo systemctl daemon-reload' after editing, if service still in memory, or just use the 'sudo systemctl edit deluge-web' function if wanted, instead of manual edits, which does itself(reloads config).

Hope helps, if not to late that is, sorry again :)