您好,登錄后才能下訂單哦!
本文將為大家詳細(xì)介紹“Linux系統(tǒng)如何設(shè)置開機(jī)默認(rèn)啟動應(yīng)用程序”,內(nèi)容步驟清晰詳細(xì),細(xì)節(jié)處理妥當(dāng),而小編每天都會更新不同的知識點(diǎn),希望這篇“Linux系統(tǒng)如何設(shè)置開機(jī)默認(rèn)啟動應(yīng)用程序”能夠給你意想不到的收獲,請大家跟著小編的思路慢慢深入,具體內(nèi)容如下,一起去收獲新知識吧。
要設(shè)置如下程序helloworld,開機(jī)運(yùn)行
[root@buildroot /usr/bin]#ls hello* helloworld [root@buildroot /usr/bin]#./helloworld hello world
1、進(jìn)入目錄
[root@buildroot /usr/bin]#cd /etc/init.d/ [root@buildroot /etc/init.d]#ls S01syslogd S40network rcS S02klogd X10modules rndis_host.modules S02sysctl X10userstart S20urandom rcK
2、新建 S10userstart,注意大寫’S’開頭的文件,才會被rcS調(diào)用并執(zhí)行!具體查看rcS文件
[root@buildroot /etc/init.d]#vi S10userstart
輸入一下內(nèi)容:
#!/bin/sh cd /usr/bin ./helloworld
并設(shè)置權(quán)限
[root@buildroot /etc/init.d]#chmod 755 S10userstart
4、重啟 reboot
[ 2.679812] Indeed it is in host mode hprt0 = 00021501 [ 2.748842] Waiting for root device /dev/mmcblk0p2... [ 2.792118] mmc0: host does not support reading read-only switch, assuming write-enable [ 2.806031] mmc0: new high speed SD card at address 0001 [ 2.817006] mmcblk0: mmc0:0001 00000 1.89 GiB [ 2.827584] mmcblk0: p1 p2 [ 2.866001] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) [ 2.880956] VFS: Mounted root (ext4 filesystem) readonly on device 179:2. [ 2.892435] devtmpfs: mounted [ 2.904567] Freeing unused kernel memory: 452K [ 2.912637] This architecture does not have kernel memory protection. [ 2.922701] Run /sbin/init as init process [ 2.930436] usb 1-1: new high-speed USB device number 2 using dwc_otg [ 2.941495] Indeed it is in host mode hprt0 = 00001101 [ 3.135289] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null) Starting syslogd: OK Starting klogd: OK Running sysctl: OK hello world Initializing random number generator: OK Saving random seed: [ 3.630197] random: dd: uninitialized urandom read (512 bytes read) OK Starting network: [ 4.020021] NET: Registered protocol family 10 [ 4.031051] Segment Routing with IPv6 ip: SIOCGIFINDEX: No such device FAIL Welcome to Buildroot for eric buildroot login: [ 5.597955] random: crng init done root Password: [root@buildroot ~]# [root@buildroot ~]#
可以看到 helloworld 已經(jīng)運(yùn)行了!
Starting syslogd: OK Starting klogd: OK Running sysctl: OK hello world
Linux是一種免費(fèi)使用和自由傳播的類UNIX操作系統(tǒng),是一個基于POSIX的多用戶、多任務(wù)、支持多線程和多CPU的操作系統(tǒng),使用Linux能運(yùn)行主要的Unix工具軟件、應(yīng)用程序和網(wǎng)絡(luò)協(xié)議。
感謝您能讀到這里,小編希望您對“Linux系統(tǒng)如何設(shè)置開機(jī)默認(rèn)啟動應(yīng)用程序”這一關(guān)鍵問題有了從實(shí)踐層面最深刻的體會,具體使用情況還需要大家自己動手實(shí)踐使用過才能領(lǐng)會,如果想閱讀更多相關(guān)內(nèi)容的文章,歡迎關(guān)注億速云行業(yè)資訊頻道!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。