Skip to content

1RaY-1/linux-startup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

A script to easily make any script startup on Linux using SYSTEMD

Tested on

  • Pop_!OS 22.04 (LTS)
  • Linux Mint (older version)
  • Fedora (older version, with SELinux set to permissive)
  • Arch Linux (older)

How to use it

After executing this script you'll have to do the following:

  1. Enter full path for the needed script
  2. Decide if you want to move it to other directory or not
  3. Decide if to execute startup script as root or as user
  4. Check if everything's fine (check if needed file exists, contains shebang, etc...)

Then

  1. It will move your script to other directory (if you want to)
  2. Make it executable
  3. Create and edit service file
  4. Reload daemon
  5. Enable service file
  6. Print useful commands to manage the service file

Installing

You can run install.sh (it'll simply move the script to a bin directory), but it's not obligatory


Uninstalling

sudo rm $(which makeit-startup)


Running

Simply execute the script without any arguments (with BASH):

sudo bash makeit-startup.sh

Problems

You can encounter problems.

To check if you have some problems with this script or not, you can try making script test.py or test.sh startup.

So

  • If after typing:
systemctl status YOUR-SERVICE-FILE

You recive an error which is saying something like: Permissions denied (will happen on SELinux distros) , then you probably need to edit /etc/selinux/config and change line:

SELINUX=enforcing 

with

SELINUX=permissive

And reboot your system

  • If you recive an error which is saying that you have a bad Unit file, you can edit your service file and try changing: [Unit] with [UNIT] or with [unit]

If you encounter more problems, please tell me by creating an issue.


More:

  • If you don't know what you are doing then don't run it, or try it out in a VM
  • You can try this out on a virtual machine before making any changes on your host, for better stability
  • Before making any script startup, make sure it has a shebang
  • If you want to understand how to manually make any script startup, here some links that will help you:

https://stackoverflow.com/questions/12973777/how-to-run-a-shell-script-at-startup

https://www.youtube.com/watch?v=-aKb-k8B8xo