MIKE LEVIN AI SEO

Future-proof your skills with Linux, Python, vim & git as I share with you the most timeless and love-worthy tools in tech through my two great projects that work great together.

How to Use the Screen Command for Linux Service

As I learn how to use the Screen Command for Linux Service, I'm documenting my journey with a blog post. I've written a file to be placed in /etc/systemd/system/ and have watched a video to help me better understand the process. Come join me as I explore this new technology!

Exploring Linux Service with the Screen Command - Join Me on My Journey!

By Michael Levin

Friday, October 28, 2022

It’s time to make the service. I’ve learned a few things.

https://www.gnu.org/software/screen/manual/html_node/Socket-Directory.html

Here’s the file that goes into /etc/systemd/system/

[Unit]
Description=Scheduling

[Service]
Type=forking
Restart=always
RestartSec=5
User=ubuntu
Group=ubuntu
Environment="SCREENDIR=/home/ubuntu/.screen"
WorkingDirectory=/home/ubuntu/repos/pulse/
ExecStart=/usr/bin/screen -dmS pulse /home/ubuntu/py310/bin/python3.10 /home/ubuntu/repos/pulse/pulse.py

[Install]
WantedBy=multi-user.target

And here’s the video:

Categories