Originally Posted by
schmitta
maybe I should write a deamon to do this?
You could define your own system service?
Create a service definition in /etc/systemd/system ... you need to be superuser "root" to do this. So you need to use "sudo" + an editor, e.g.
Code:
sudo gedit /etc/systemd/system/serial-term.service
OR:
sudo vim /etc/systemd/system/serial-term.service
OR:
sudo nano /etc/systemd/system/serial-term.service
(... whichever editor works for you and you are comfortable with ...)
Content could be something like this:
Code:
[Unit]
Description=Serial-Terminal
Requires=network.target
After=systemd-user-sessions.service
[Service]
Type=simple
Restart=always
# Please edit the line below as needed.
# Use the full path to the program you wish to run
ExecStart=/full/path/to/the/term/program
# If you leave "User=" away then superuser "root" will be used.
# The user you use here MUST HAVE permission to run the program
# AND the permission to access / read / write to the serial device.
# Either create such a user or use "root".
User=mytermserviceuser
[Install]
WantedBy=multi-user.target
Once that's done you can tell "systemctl" to reload all its service definitions:
Code:
sudo systemctl daemon-reload
If there's no error message it means this was a success.
Now you can enable and start the service:
Code:
sudo systemctl enable serial-term.service
sudo systemctl start serial-term.service
You can check if it has worked by e.g.:
Code:
sudo systemctl status serial-term.service
You can investigate errors e.g. by:
Code:
sudo journalctl -xe