Sunday, October 17, 2021

Creating a user service on Linux

 This is an example of running a local python script as a user service.

Most of this information was found  here.


Service location:

/home/user/.config/systemd/servicename.service


Service definition/contents of servicename.service

[Unit]
Description=Metriful User Service

[Service]
ExecStart=/usr/bin/python3 /home/user/script.py
Restart=on-failure

[Install]
WantedBy=default.target


Reload Systemd so it can find the new service

systemctl --user daemon-reload


Enable Service with

systemctl --user enable servicename.service


Let Service run even when all user sessions have expired

loginctl enable-linger <user>

Monday, October 11, 2021

ZSH First time run

These are the commands to re-run ZSH first time setup.


autoload -Uz zsh-newuser-install
zsh-newuser-install -f