[英]Run script on Startup on openSUSE
任務 :在openSUSE上啟動時運行chrome
至今:
首先,我不知道走什么路,可以用Cron或rc.local來實現。 我不知道哪種觀點最好
Cron:
知道這不是一個好主意
rc.local
所以我有這個腳本:
Fri Aug 11; 06:10:38; marton;/etc/init.d ; $ cat /etc/init.d/chrom_start.sh
#!/bin/bash
/usr/lib64/chromium/chromium
exit 0
我擁有該文件的權限:
Fri Aug 11; 06:11:09; marton;/etc/init.d ; $ ls -l /etc/init.d/chrom_start.sh
-rwxrwxr-x 1 root root 48 Aug 11 06:10 /etc/init.d/chrom_start.sh
openSUSE沒有update-rc.d
Fri Aug 11; 06:12:48; marton;/etc/init.d ; $ update-rc.d
If 'update-rc.d' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf update-rc.d
我似乎找不到該示例:
Fri Aug 11; 06:13:18; marton;/etc/init.d ; $ cat /etc/init.d/skeleton
cat: /etc/init.d/skeleton: No such file or directory
我發現必須使用安裝作業,但它不存在
Fri Aug 11; 06:20:35; marton;/etc/init.d ; $ %install
bash: fg: %install: no such job
因此,如果一切正常,我只需要找到一種方法即可將守護程序設置為在啟動時運行,考慮到我沒有此框架文件並且這些安裝作業不存在,下一步該怎么做?
我不知道這是否會對OpenSUSE有所幫助,但這是一個有關“如何自動啟動Chromium”的主題:
https://raspberrypi.stackexchange.com/questions/38515/auto-start-chromium-on-raspbian-jessie-11-2015
這可能也有幫助。
如果您正在使用bash(這是最可能的情況),則可以編輯.bash_profile
文件或.bash_login
(兩者都應位於用戶的主目錄中)。
您需要在末尾添加鉻的路徑,例如:
/usr/bin/chromium&
最后的&
是使其作為后台進程運行。 如果要對每個用戶應用此更改,則可以在/etc/skel
上編輯.bash_login文件。
希望能幫助到你,
ps。 這是一個可能會有所幫助的網址。
http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_03_01.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.