Ubu18開機自啟動

2022-09-23 12:51:10 字數 983 閱讀 8278

簡單示例

/etc/init.d/目錄下新建啟動指令碼test

#!/bin/bash

### begin init info

# provides: test

# required-start:

# required-stop:

# default-start: 2 3 4 5

# default-stop: 0 1 6

# short-description: autostart service

# description: 開啟自啟動指令碼

### end init info

file_path="/home/***/filepath" #檔案路徑

file_name="test.py" #檔名

#開始方法

start()

#結束方法

stop() '`

echo "$my_path stop success."

}case "$1" in

start)

start

;;stop)

stop

;;restart)

stop

start

;;*) echo "userage: $0 "

exit 1

esac

cd /etc/init.d

sudo systemctl enable test

test服務就加入到開機啟動過程中

通過systemctl系列命令對服務進行管理,包括status,start,restart

開機自啟動

1.建立uid3.rss uid3 是mmp 中的 uid 0x100039ce 0xeb32ada7 0xeb32ada7 需要建立的檔案名字是 eb32ada7.rss 建立到工程名下的 data 目錄下 該檔案的內容格式如下 include resource startup item info...

開機自啟動

使程式可以隨windows自啟動的方式有 1.啟動資料夾 將程式或程式的快捷方式放置到啟動資料夾 xp 系統路徑 documents and settings administrator 開始 選單 程式 啟動 win7 2.登錄檔 當前使用者 1 hkey current user softwar...

開機自啟動

注意 一 如果檔案在c program files x86 下,這時無論使用system 命令還是bat命令列,都無法實現,因為系統無法識別空格。這樣需要在program files x86 新增雙引號,即 c program files x86 如果是bat命令列 c program files ...