/opt/daemon/service/secu_unix_stream_logging.py
~/.config/systemd/user/secu_logging.service
[Unit]
Description=secu_logging service
[Service]
Type=simple
Restart=on-failure
RestartSec=3
TimeoutStopSec=20
ExecStart=/usr/bin/python3 /opt/daemon/service/secu_unix_stream_logging.py
[Install]
WantedBy=multi-user.target
- auto start when system start-up, replace [Install] section by following
- WantedBy=default.target
systemctl --user daemon-reload
systemctl --user start secu_logging.service
if you want to make your service auto start-up when system boot
systemctl --user enable secu_logging.service
systemctl --user status secu_logging.service
systemctl --user stop secu_logging.service
/opt/daemon/service/secu_logging.py
~/.config/systemd/user/secu_logging.service
[Unit]
Description=secu_logging service
After=network.target secu_logging.socket
Requires=secu_logging.socket
[Service]
Type=simple
Restart=on-failure
RestartSec=3
TimeoutStopSec=20
ExecStart=/usr/bin/python3 /opt/daemon/service/secu_logging.py
[Install]
WantedBy=multi-user.target
- auto start when system start-up, replace [Install] section by following
- WantedBy=default.target
~/.config/systemd/user/secu_logging.socket
[Unit]
Description=Logging Socket
PartOf=secu_logging.service
[Socket]
ListenStream=127.0.0.1:9020
[Install]
WantedBy=sockets.target
systemctl --user status secu_logging.socket
systemctl --user stop secu_logging.socket
systemctl --user daemon-reload
systemctl --user start secu_logging.socket
if you want to make your service auto start-up when system boot
systemctl --user enable secu_logging.service
journalctl -f --user-unit secu_logging.service