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

Priority analysis of and or queries in MySQL

This may be an issue that is easily overlooked. F...

How to add and delete unique indexes for fields in MySQL

1. Add PRIMARY KEY (primary key index) mysql>A...

A brief discussion on logic extraction and field display of Vue3 in projects

Table of contents Logical Layering Separate busin...

Vue3+script setup+ts+Vite+Volar project

Table of contents Create a vue + ts project using...

Detailed explanation of CSS background and border tag examples

1. CSS background tag 1. Set the background color...

W3C Tutorial (9): W3C XPath Activities

XPath is a language for selecting parts of XML do...

Detailed explanation of docker visualization graphics tool portainer

Table of contents 1. Introduction to Portainer 2....

Implementing a random roll caller based on JavaScript

This article shares the specific code of JavaScri...

Ant Design Blazor component library's routing reuse multi-tab function

Recently, there has been a growing demand for imp...

Pure CSS to achieve the water drop animation button in Material Design

Preface You should often see this kind of special...

Detailed explanation of Vue lazyload picture lazy loading example

Documentation: https://github.com/hilongjw/vue-la...

Elegant practical record of introducing iconfont icon library into vue

Table of contents Preface Generate SVG Introducti...

A brief summary of all encapsulation methods in Vue

Table of contents 1. Encapsulation API 2. Registe...

Introduction to RHCE bridging, password-free login and port number modification

Table of contents 1. Configure bridging and captu...