The easiest way to make a program run automatically at startup in Linux

The easiest way to make a program run automatically at startup in Linux

I collected a lot of them, but all ended in failure. Finally, I found that this method is good and does not affect the usage. It is more important for the system with xampp installed. I hope you agree. Here’s how:

Create a new file in the /etc/init.d directory and set the file permissions to be executable. You can choose any name you want, I named it: xamppv. The content is as follows, especially the first few lines with #, which are indispensable and cannot be changed.

#!/bin/sh
### BEGIN INIT INFO
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
sudo /opt/lampp/xampp start

Save the above files in the /etc/init.d directory and execute the following commands. sudo systemctl enable xamppv, sudo systemctl start xamppv can start the program immediately. The following commands can be used, but it doesn't matter if you don't use them. update-rc.d xampp defaults 400.

The settings are complete, restart your computer!

The above is the method and code content introduced in this article about how to make the program run automatically when the computer starts up in Linux. Thank you for your learning and support for 123WORDPRESS.COM.

<<:  Vue3 implements Message component example

>>:  A brief introduction to the usage of decimal type in MySQL

Recommend

Vue custom v-has instruction to implement button permission judgment

Application Scenario Taking the background manage...

Detailed explanation of routes configuration of Vue-Router

Table of contents introduce Object attributes in ...

Vue computed properties

Table of contents 1. Basic Examples 2. Computed p...

Nginx reverse proxy and load balancing practice

Reverse Proxy Reverse proxy refers to receiving t...

Defining the minimum height of the inline element span

The span tag is often used when making HTML web p...

Implementation example of Docker rocketmq deployment

Table of contents Preparation Deployment process ...

Docker mounts local directories and data volume container operations

1. Docker mounts the local directory Docker can s...

How to create users and manage permissions in MySQL

1. How to create a user and password 1. Enter the...

Deploy Nginx+Flask+Mongo application using Docker

Nginx is used as the server, Mongo is used as the...

JS implements a detailed plan for the smooth version of the progress bar

The progress bar is not smooth I believe that mos...

Summary of 50+ Utility Functions in JavaScript

JavaScript can do a lot of great things. This art...