-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Start Glances through Systemd
Nicolas Hennion edited this page Jul 7, 2024
·
12 revisions
Note: if you install Glances with pip and the --user option, you should set the User in the systemd file. Please read https://github.com/nicolargo/glances/issues/2673.
Create a new unit by creating a file called glances.service in the /etc/systemd/system/ folder.
[Unit]
Description=Glances
After=network.target
[Service]
ExecStart=/usr/local/bin/glances -s
Restart=always
RemainAfterExit=no
[Install]
WantedBy=multi-user.target
[Unit]
Description=Glances
After=network.target
[Service]
ExecStart=/usr/local/bin/glances -w
Restart=always
RemainAfterExit=no
[Install]
WantedBy=multi-user.target
[Unit]
Description=Glances
After=network.target influxd.service
[Service]
ExecStart=/usr/local/bin/glances --quiet --export influxdb
Restart=always
RemainAfterExit=no
RestartSec=30s
TimeoutSec=30s
[Install]
WantedBy=multi-user.target
sudo systemctl enable glances.service
sudo systemctl start glances.service
If your system is protected by SeLinux, please read the following tips: https://github.com/nicolargo/glances/issues/2673#issuecomment-2212320260