This shows you the differences between two versions of the page.
Previous revisionNext revision | |||
— | fuss:systemd [2021/01/22 23:20] – [Starting Programs on Virtual Terminals] office | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Making Changes to Daemon Files ====== | ||
+ | Whenever a daemon file is changed in ''/ | ||
+ | <code bash> | ||
+ | systemctl daemon-reload | ||
+ | </ | ||
+ | |||
+ | ====== Starting Programs on Virtual Terminals ====== | ||
+ | |||
+ | Most *nix derivates start a login program such as '' | ||
+ | |||
+ | The procedure with systemd is a little different and involves shutting down the tty services and creating a service file. The first thing to do is run: | ||
+ | <code bash> | ||
+ | systemctl | ||
+ | </ | ||
+ | |||
+ | and search (using forward-slash ''/'' | ||
+ | < | ||
+ | getty@tty1.service | ||
+ | getty@tty2.service | ||
+ | getty@tty6.service | ||
+ | </ | ||
+ | |||
+ | which means that '' | ||
+ | |||
+ | In order for '' | ||
+ | <code bash> | ||
+ | systemctl stop getty@tty1.service | ||
+ | systemctl disable getty@tty1.service | ||
+ | </ | ||
+ | |||
+ | Next, add the following contents to a file placed at ''/ | ||
+ | < | ||
+ | [Unit] | ||
+ | Description=htop on tty1 | ||
+ | |||
+ | [Service] | ||
+ | Type=simple | ||
+ | ExecStart=/ | ||
+ | StandardInput=tty | ||
+ | StandardOutput=tty | ||
+ | TTYPath=/ | ||
+ | Restart=always | ||
+ | RestartSec=2 | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=getty.target | ||
+ | </ | ||
+ | where: | ||
+ | * ''/ | ||
+ | |||
+ | You can now enable and start the service via: | ||
+ | <code bash> | ||
+ | systemctl enable htop.service | ||
+ | systemctl start htop.service | ||
+ | </ | ||
+ | |||
+ | and '' | ||
+ | |||
+ | ====== Set Runlevel ====== | ||
+ | |||
+ | The SystemD version of '' | ||
+ | <code bash> | ||
+ | systemctl isolate multi-user.target | ||
+ | </ | ||
+ | |||
+ | and the '' | ||
+ | <code bash> | ||
+ | systemctl isolate graphical.target | ||
+ | </ | ||
+ | |||
+ |