[GH-ISSUE #62] Time to move on systemd =) #40

Closed
opened 2026-02-27 15:57:07 +03:00 by kerem · 2 comments
Owner

Originally created by @savichev on GitHub (Oct 22, 2015).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/62

Please test it on Ubuntu/Debian

stop application

supervisorctl stop webvirtcloud
supervisorctl stop novnc

create file webvirtcloud.service

[Unit]
Description=WebVirtCloud Core Service
Requires=novnc.service
Before=novnc.service
AssertPathExists=
AssertPathExists=/var/www/webvirtcloud/venv

[Service]
#Type=simple
User=www-data
Group=www-data
WorkingDirectory=/var/www/webvirtcloud
ExecStart=/var/www/webvirtcloud/venv/bin/gunicorn webvirtcloud.wsgi:application -c /var/www/webvirtcloud/gunicorn.conf.py
StandardOutput=syslog
StandardError=syslog
Restart=always
RestartSec=30
#KillMode=process
#IgnoreSIGPIPE=no
#SendSIGHUP=yes

[Install]
WantedBy=multi-user.target

and create file create file novnc.service

[Unit]
Description=WebVirtCloud NoVNC Service
Requires=webvirtcloud.service
After=webvirtcloud.service
AssertPathExists=
AssertPathExists=/var/www/webvirtcloud/venv

[Service]
User=www-data
Group=www-data
WorkingDirectory=/var/www/webvirtcloud
ExecStart=/var/www/webvirtcloud/venv/bin/python /var/www/webvirtcloud/console/novncd
StandardOutput=syslog
StandardError=syslog

[Install]
WantedBy=multi-user.target

copy file webvirtcloud.service and novnc.service to /lib/systemd/system/

sudo cp webvirtcloud.service /lib/systemd/system/
sudo cp novnc.service /lib/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable webvirtcloud
sudo systemctl enable novnc

(Output):

Created symlink from /etc/systemd/system/multi-user.target.wants/webvirtcloud.service to /lib/systemd/system/webvirtcloud.service.
sudo systemctl start webvirtcloud

sudo systemctl status webvirtcloud

(Output):

webvirtcloud.service - WebVirtCloud Core Service
   Loaded: loaded (/lib/systemd/system/webvirtcloud.service; enabled)
   Active: active (running) since Чт 2015-10-22 12:47:19 YEKT; 28min ago
 Main PID: 28325 (gunicorn)
   CGroup: /system.slice/webvirtcloud.service

...(cut)
sudo systemctl status novnc

output

novnc.service - WebVirtCloud NoVNC Service
   Loaded: loaded (/lib/systemd/system/novnc.service; enabled)
   Active: active (running) since Пт 2015-10-23 16:51:38 YEKT; 4min 6s ago
Originally created by @savichev on GitHub (Oct 22, 2015). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/62 Please test it on **Ubuntu/Debian** stop application ``` supervisorctl stop webvirtcloud supervisorctl stop novnc ``` create file **webvirtcloud.service** ``` [Unit] Description=WebVirtCloud Core Service Requires=novnc.service Before=novnc.service AssertPathExists= AssertPathExists=/var/www/webvirtcloud/venv [Service] #Type=simple User=www-data Group=www-data WorkingDirectory=/var/www/webvirtcloud ExecStart=/var/www/webvirtcloud/venv/bin/gunicorn webvirtcloud.wsgi:application -c /var/www/webvirtcloud/gunicorn.conf.py StandardOutput=syslog StandardError=syslog Restart=always RestartSec=30 #KillMode=process #IgnoreSIGPIPE=no #SendSIGHUP=yes [Install] WantedBy=multi-user.target ``` and create file create file **novnc.service** ``` [Unit] Description=WebVirtCloud NoVNC Service Requires=webvirtcloud.service After=webvirtcloud.service AssertPathExists= AssertPathExists=/var/www/webvirtcloud/venv [Service] User=www-data Group=www-data WorkingDirectory=/var/www/webvirtcloud ExecStart=/var/www/webvirtcloud/venv/bin/python /var/www/webvirtcloud/console/novncd StandardOutput=syslog StandardError=syslog [Install] WantedBy=multi-user.target ``` copy file webvirtcloud.service and novnc.service to /lib/systemd/system/ ``` sudo cp webvirtcloud.service /lib/systemd/system/ sudo cp novnc.service /lib/systemd/system/ ``` ``` sudo systemctl daemon-reload sudo systemctl enable webvirtcloud sudo systemctl enable novnc ``` (Output): ``` Created symlink from /etc/systemd/system/multi-user.target.wants/webvirtcloud.service to /lib/systemd/system/webvirtcloud.service. ``` ``` sudo systemctl start webvirtcloud sudo systemctl status webvirtcloud ``` (Output): ``` webvirtcloud.service - WebVirtCloud Core Service Loaded: loaded (/lib/systemd/system/webvirtcloud.service; enabled) Active: active (running) since Чт 2015-10-22 12:47:19 YEKT; 28min ago Main PID: 28325 (gunicorn) CGroup: /system.slice/webvirtcloud.service ...(cut) ``` ``` sudo systemctl status novnc ``` output ``` novnc.service - WebVirtCloud NoVNC Service Loaded: loaded (/lib/systemd/system/novnc.service; enabled) Active: active (running) since Пт 2015-10-23 16:51:38 YEKT; 4min 6s ago ```
kerem closed this issue 2026-02-27 15:57:07 +03:00
Author
Owner

@savichev commented on GitHub (Oct 23, 2015):

test

sudo systemctl stop novnc
sudo systemctl stop webvirtcloud

sudo systemctl start webvirtcloud
sudo systemctl status novnc

output

novnc.service - WebVirtCloud NoVNC Service
   Loaded: loaded (/lib/systemd/system/novnc.service; enabled)
   Active: active (running) since Пт 2015-10-23 16:37:32 YEKT; 3min 4s ago
sudo systemctl stop webvirtcloud
sudo systemctl status novnc

output

● novnc.service - WebVirtCloud NoVNC Service
   Loaded: loaded (/lib/systemd/system/novnc.service; enabled)
   Active: inactive (dead) since Пт 2015-10-23 16:41:53 YEKT; 44s ago
sudo systemctl start webvirtcloud
sudo systemctl status webvirtcloud

output

webvirtcloud.service - WebVirtCloud Core Service
   Loaded: loaded (/lib/systemd/system/webvirtcloud.service; enabled)
   Active: active (running) since Пт 2015-10-23 16:51:38 YEKT; 3min 12s ago
sudo systemctl status novnc

output

novnc.service - WebVirtCloud NoVNC Service
   Loaded: loaded (/lib/systemd/system/novnc.service; enabled)
   Active: active (running) since Пт 2015-10-23 16:51:38 YEKT; 4min 6s ago

final
remove conf in superviserd

rm /etc/supervisor/conf.d/webvirtcloud.conf
<!-- gh-comment-id:150552047 --> @savichev commented on GitHub (Oct 23, 2015): test ``` sudo systemctl stop novnc sudo systemctl stop webvirtcloud sudo systemctl start webvirtcloud sudo systemctl status novnc ``` output ``` novnc.service - WebVirtCloud NoVNC Service Loaded: loaded (/lib/systemd/system/novnc.service; enabled) Active: active (running) since Пт 2015-10-23 16:37:32 YEKT; 3min 4s ago ``` ``` sudo systemctl stop webvirtcloud sudo systemctl status novnc ``` output ``` ● novnc.service - WebVirtCloud NoVNC Service Loaded: loaded (/lib/systemd/system/novnc.service; enabled) Active: inactive (dead) since Пт 2015-10-23 16:41:53 YEKT; 44s ago ``` ``` sudo systemctl start webvirtcloud sudo systemctl status webvirtcloud ``` output ``` webvirtcloud.service - WebVirtCloud Core Service Loaded: loaded (/lib/systemd/system/webvirtcloud.service; enabled) Active: active (running) since Пт 2015-10-23 16:51:38 YEKT; 3min 12s ago ``` ``` sudo systemctl status novnc ``` output ``` novnc.service - WebVirtCloud NoVNC Service Loaded: loaded (/lib/systemd/system/novnc.service; enabled) Active: active (running) since Пт 2015-10-23 16:51:38 YEKT; 4min 6s ago ``` final remove conf in superviserd ``` rm /etc/supervisor/conf.d/webvirtcloud.conf ```
Author
Owner

@ckbaker10 commented on GitHub (May 28, 2024):

Hello,

I've installed this tool on ubuntu 22.04 ahead of reading this and wrote some nice service files utilizing environment variables for path configurations.

https://github.com/retspen/webvirtcloud/pull/646

<!-- gh-comment-id:2134747089 --> @ckbaker10 commented on GitHub (May 28, 2024): Hello, I've installed this tool on ubuntu 22.04 ahead of reading this and wrote some nice service files utilizing environment variables for path configurations. https://github.com/retspen/webvirtcloud/pull/646
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtcloud#40
No description provided.