Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to make services in linux

[Unit]
Description=<description about this service>

[Service]
User=<user e.g. root>
WorkingDirectory=<directory_of_script e.g. /root>
ExecStart=<script which needs to be executed>
Restart=always

[Install]
WantedBy=multi-user.target
Comment

linux services

# Check if the service is running
systemctl status SERVICE_NAME.service

# Stop service
systemctl stop SERVICE_NAME.service

# Check if autostart is enabled
systemctl is-enabled SERVICE_NAME.service

# Disable autostart
systemctl disable SERVICE_NAME.service
Comment

PREVIOUS NEXT
Code Example
Shell :: git cherry pick example 
Shell :: delete a daemonset deployment 
Shell :: vite command 
Shell :: kubernetes get persistent volumes 
Shell :: linux keyboard layout cli 
Shell :: install ros 
Shell :: git modify last commit message 
Shell :: conda update with environment from yml file 
Shell :: bash modify file text 
Shell :: gitignore files that are already tracked 
Shell :: linux how to remove all files with grep 
Shell :: remove file via command line 
Shell :: how to apply changes in a single file from stash 
Shell :: docker ps not showing containers 
Shell :: git get access to private repository 
Shell :: video editor for ubuntu 21.10 
Shell :: mkdir -p vs mkdir 
Shell :: kibana download 
Shell :: digital ocear error Permission denied (publickey). 
Shell :: set up ssh for github 
Shell :: static ip wsl2 
Shell :: to take screenshot in ubuntu 
Shell :: spotify ubuntu 
Shell :: ubuntu 20.04 ifconfig public ip address 
Shell :: add folders to gitignore 
Shell :: sed delete line match 
Shell :: start docker image 
Shell :: how to encrypt and decrypt a text file using openssl rsa public and private keys 
Shell :: display settings ubuntu 20.04 in right side 
Shell :: give sudo permission to vim ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =