Running via systemd on Linux #6049
Replies: 6 comments 5 replies
-
It seems like the issue is that launch.py isn't actually being run. Systemd services scare me so instead I would just throw webui.sh into my rc.local and call it a day. If it has to be through Systemd you could try running "webui-user.sh" with all of the directories set manually(install, python, venv, etc.) to see if that makes a difference. I'd assume that if there was an issue with these things it would output the error message, but I have no idea how systemd handles output from secondary scripts. |
Beta Was this translation helpful? Give feedback.
-
I had this problem, too. launch.py is definitely being run (you can see it in After a lot of head banging it turns out python is just being weird: https://stackoverflow.com/questions/72257419/systemd-says-my-service-is-active-and-started-but-i-receive-no-output If you modify the end of webui.sh to put a |
Beta Was this translation helpful? Give feedback.
-
I had this problem too, and the service only work after removing the WantedBy directive. |
Beta Was this translation helpful? Give feedback.
-
I was struggling with this a bit and was writing a post asking for help when it started working. for anyone else who comes across this and might be confused by the back and forth above, here is what I did. This is on Arch. I created /etc/systemd/system/automatic1111.service with the following content:
then ran "systemctl enable automatic1111.service". Then just reboot and check the status with "systemctl status automatic1111.service" to confirm it is running. "cat /var/log/sdwebui.log" seems to show it gets stuck at the following, but the webui launches after a few minutes and seems to be working.
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the comments on this thread. I had to add the WantedBy clause and also create an empty log file. Here is what that worked for me. File: /etc/systemd/system/automatic1111.service
Note: In my case the user account is simply "user" and path is '/home/user/ai/automatic1111/'. Please adjust this based on your setup. Add Then create the /var/log/sdwebui.log file. Finally enable the service. |
Beta Was this translation helpful? Give feedback.
-
Still no official service or documentation? If not is there any problem with the last solution? |
Beta Was this translation helpful? Give feedback.
-
Has anyone been able to run webui.sh via a systemd service script on Linux? I've tried and it just hangs at "Launching launch.py..."
`$ cat /etc/systemd/system/sdwebui.service
[Unit]
Description=Stable Diffusion AUTOMATIC1111 Web UI service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=john
ExecStart=/usr/bin/env bash /home/john/stable-diffusion-webui/webui.sh
StandardOutput=append:/var/log/sdwebui.log
StandardError=append:/var/log/sdwebui.log
[Install]
WantedBy=multi-user.target
`
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions