Hope to see you again!
«How Google Detects AdSense...
I have a Dream»

Making scripts run at boot time with Debian

I use virtualbox to install debian 4.0 in my windows system.So I can use linux again.In fact I have never used the system for a long time.It's a good experience this time.Virtualbox is a good open source.Very good.

 

If you want to make scripts run at boot time with debain.Just following:

Debian uses a Sys-V like init system for executing commands when the system runlevel changes - for example at bootup and shutdown time.

If you wish to add a new service to start when the machine boots you should add the necessary script to the directory /etc/init.d/. Many of the scripts already present in that directory will give you an example of the kind of things that you can do.

Here's a very simple script which is divided into two parts, code which always runs, and code which runs when called with "start" or "stop".

#! /bin/sh # /etc/init.d/blah #  # Some things that run always touch /var/lock/blah  # Carry out specific functions when asked to by the system case "$1" in   start)     echo "Starting script blah "     echo "Could do more here"     ;;   stop)     echo "Stopping script blah"     echo "Could do more here"     ;;   *)     echo "Usage: /etc/init.d/blah {start|stop}"     exit 1     ;; esac  exit 0  

Once you've saved your file into the correct location make sure that it's executable "chmod 755 /etc/init.d/blah.

Then you need to add the appropriate symbolic links to cause the script to be executed when the system goes down, or comes up.

The simplest way of doing this is to use the Debian-specific command update-rc.d:

root@skx:~# update-rc.d blah defaults  Adding system startup for /etc/init.d/blah ...    /etc/rc0.d/K20blah -> ../init.d/blah    /etc/rc1.d/K20blah -> ../init.d/blah    /etc/rc6.d/K20blah -> ../init.d/blah    /etc/rc2.d/S20blah -> ../init.d/blah    /etc/rc3.d/S20blah -> ../init.d/blah    /etc/rc4.d/S20blah -> ../init.d/blah    /etc/rc5.d/S20blah -> ../init.d/blah 

If you wish to remove the script from the startup sequence in the future run:

root@skx:/etc/rc2.d# update-rc.d -f  blah remove update-rc.d: /etc/init.d/blah exists during rc.d purge (continuing)  Removing any system startup links for /etc/init.d/blah ...    /etc/rc0.d/K20blah    /etc/rc1.d/K20blah    /etc/rc2.d/S20blah    /etc/rc3.d/S20blah    /etc/rc4.d/S20blah    /etc/rc5.d/S20blah    /etc/rc6.d/K20blah 

This will leave the script itself in place, just remove the links which cause it to be executed.

You can find more details of this command by running "man update-rc.d".

Posted by: freesu, 05/29 2007, 17:28 | Linux world | Comments (67) | Permalink | Trackbacks (0)

67 Responses to “Making scripts run at boot time with Debian”

2
xic 01/23 2008, 18:08 Say: [Reply]

xic
sdevefd
Warhammer Online Age of Reckoning Gold Warhammer Online money Warhammer leveling

If money could buy kingdoms in WoW, then a gold-hugging German World of Warcraft player who has discovered the game s cash limit for a single character ...

3
yao 01/23 2008, 18:40 Say: [Reply]

yao
jdkljgkaldjgfdsg

eve isk eve online isk buy eve isk cheap eve isk
EVE ISK, EVE Online ISK, Buy EVE ISK, Cheap EVE ISK. We provide cheap Cheap EVE ISK to reliable customer. Buy EVE ISK here, we are professional EVE Online ...

4
lcy 01/23 2008, 19:22 Say: [Reply]

lcy
lcygwb12
maple story mesos
buy maple story mesos
cheap maple story mesos

There are easier ways of getting more gold into your account. There are several different WoW gold guides available that explain all the shortcuts and the ...

6
Anonymity 02/12 2008, 20:17 Say: [Reply]

鬼guiguipy
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
world of warcraft gold
buy wow gold
buy wow gold
buy wow gold
buy wow gold
buy wow gold
buy wow gold
buy wow gold
buy wow gold
buy world of warcraft gold
buy world of warcraft gold
buy world of warcraft gold
buy world of warcraft gold
cheap wow gold
cheap wow gold
cheap wow gold
cheap wow gold
cheap world of warcraft gold
cheap world of warcraft gold
cheap world of warcraft gold
cheap world of warcraft gold
wow account
wow account
wow account
wow account
wow account
wow account
buy wow account
buy wow account
buy wow account
buy wow account
buy wow account
world of warcraft account
world of warcraft account
world of warcraft account
world of warcraft account
world of warcraft account
world of warcraft account
world of warcraft account
buy world of warcraft account
buy world of warcraft account
buy world of warcraft account
wow power leveling
wow power leveling
wow power leveling
wow power level
wow power level
wow power level
wow power level
world of warcraft power leveling
world of warcraft power leveling
world of warcraft power leveling
world of warcraft power leveling
world of warcraft power level
world of warcraft power level
world of warcraft power level
world of warcraft power level
ffxi gil
ffxi gil
ffxi gil
ffxi gil
ffxi gil
ffxi gil
ffxi gil
ffxi gil
lineage 2 adena
lineage 2 adena
lineage 2 adena
lineage 2 adena
lineage 2 adena
lineage 2 adena
maple story mesos
maple story mesos
maple story mesos
maple story mesos
maple story mesos
buy maple story mesos
buy maple story mesos
buy maple story mesos
buy maple story mesos
cheap maple story mesos
cheap maple story mesos
cheap maple story mesos
cheap maple story mesos
lotr gold
lotr gold
lotr gold
lotr gold
lotr gold
buy lotr gold
buy lotr gold
buy lotr gold
buy lotr gold
buy lotr gold
eve isk
eve isk
eve online isk
eve online isk
buy eve isk
buy eve isk
buy eve isk
buy eve isk
cheap eve isk
cheap eve isk
cheap eve isk
cheap eve isk
eq2 gold
eq2 plat
eq2 plat
eq2 plat
eq2 plat
eq2 plat
eq2 plat
eq2 plat
eq2 plat
eq2 plat
eq2 plat
guild wars gold
guild wars gold
guild wars gold
guild wars gold
guild wars gold
guild wars gold

8
Anonymity 02/15 2008, 22:56 Say: [Reply]

yzz-xjm

wow gold
wow powerleveling
SEO软件
砂浆
保温砂浆
干粉砂浆

水泵
离心泵
化工泵
隔膜泵
排污泵
管道泵
wow gold
wow gold
wow gold
wow gold
wow gold

world of warcraft gold
world of warcraft gold
world of warcraft gold

buy wow gold
buy wow gold
buy wow gold

buy world of warcraft gold
buy world of warcraft gold
buy world of warcraft gold

cheap wow gold
cheap wow gold
cheap wow gold

cheap world of warcraft gold
cheap world of warcraft gold
cheap world of warcraft gold

cheap world of warcraft gold
cheap world of warcraft gold
cheap world of warcraft gold

wow account
wow account
wow account

buy wow account
buy wow account
buy wow account

world of warcraft account
world of warcraft account
world of warcraft account

buy world of warcraft account
buy world of warcraft account
buy world of warcraft account

wow power leveling
wow power leveling
wow power leveling

wow power level
wow power level
wow power level

world of warcraft power leveling
world of warcraft power leveling
world of warcraft power leveling

world of warcraft power level
world of warcraft power level
world of warcraft power level

ffxi gil
ffxi gil
ffxi gil

lineage 2 adena
lineage 2 adena
lineage 2 adena

maple story mesos
maple story mesos
maple story mesos

lotr gold
lotr gold
lotr gold

buy lotr gold
buy lotr gold
buy lotr gold

eve isk
eve isk
eve isk

eve online isk
eve online isk
eve online isk

eve online isk
eve online isk
eve online isk

buy eve isk
buy eve isk
buy eve isk

cheap eve isk
cheap eve isk
cheap eve isk

eq2 gold
eq2 gold
eq2 gold

eq2 plat
eq2 plat
eq2 plat

guild wars gold
guild wars gold
guild wars gold

xujingmei
xujingmei

10
10/22 2008, 04:53 Say: [Reply]

SEXlink1

11
10/23 2008, 05:57 Say: [Reply]

12
10/24 2008, 02:55 Say: [Reply]

13
10/25 2008, 03:10 Say: [Reply]

14
10/27 2008, 06:39 Say: [Reply]

15
10/29 2008, 05:32 Say: [Reply]

16
10/30 2008, 06:20 Say: [Reply]

17
10/31 2008, 05:03 Say: [Reply]

SEX

18
11/02 2008, 05:02 Say: [Reply]

19
11/03 2008, 03:40 Say: [Reply]

20
11/04 2008, 01:54 Say: [Reply]

21
11/04 2008, 22:47 Say: [Reply]

22
11/06 2008, 02:21 Say: [Reply]

23
SNS 11/06 2008, 23:01 Say: [Reply]

24
11/09 2008, 04:07 Say: [Reply]

25
SM 11/10 2008, 03:32 Say: [Reply]

26
11/11 2008, 23:40 Say: [Reply]

27
11/12 2008, 23:25 Say: [Reply]

28
11/14 2008, 00:30 Say: [Reply]

29
11/14 2008, 23:54 Say: [Reply]

30
11/16 2008, 00:22 Say: [Reply]

31
11/17 2008, 02:16 Say: [Reply]

32
11/18 2008, 02:40 Say: [Reply]

33
11/18 2008, 23:46 Say: [Reply]

34
11/20 2008, 00:39 Say: [Reply]

35
11/21 2008, 00:23 Say: [Reply]

36
11/22 2008, 02:59 Say: [Reply]

37
11/23 2008, 00:27 Say: [Reply]

38
出会いサイト 11/24 2008, 03:08 Say: [Reply]

出会い出会い出会い系サイト出会い喫茶出会い掲示板ナンパ出会いカフェ人妻出会い無料系サイト優良出会い系攻略完全無料。アダルトビデオアダルト動画アダルトアニメアダルト画像アダルトサイト無料DVDアダルト風俗サンプル無料風俗優良アダルトサイト比較海外。人妻画像人妻パラダイス知合い人妻援護会人妻SMコレクション風俗告白。熟女画像東京熟女掲示板動画熟女ビデオおまんこオナニーエロ画像エロフラッシュアニメエロ動画エロゲームエロ漫画無料エロサイト。エッチ画像エッチ動画エッチ小説写真エッチアニメエッチ0930。セックスアナルセックス画像セックス動画カーセックスセックスフレンドスワッピングSEX写真セックスボランティセックス体位東京セックス仕方SEX。おっぱい画像おっぱい村長おっぱい楽園掲示板おっぱい命おっぱいゲーム。巨乳動画巨乳画像アイドル巨乳掲示板風俗。セフレ募集セフレ掲示板セフレ画像掲示板セフレの作り方出会い無料素人セフレ。童貞狩りエロ漫画童貞狩り童貞喪失童貞オークション素人童貞逆援不倫パートナー不倫出会い人妻不倫

39
11/25 2008, 00:50 Say: [Reply]

40
11/26 2008, 03:17 Say: [Reply]

41
11/28 2008, 00:33 Say: [Reply]

42
11/29 2008, 00:23 Say: [Reply]

43
11/30 2008, 00:20 Say: [Reply]

44
12/04 2008, 23:29 Say: [Reply]

45
12/06 2008, 03:52 Say: [Reply]

46
12/06 2008, 23:50 Say: [Reply]

SEX

47
12/08 2008, 23:51 Say: [Reply]

48
12/09 2008, 22:32 Say: [Reply]

49
12/10 2008, 22:26 Say: [Reply]

50
12/11 2008, 23:47 Say: [Reply]

51
SM 12/17 2008, 22:33 Say: [Reply]

52
12/18 2008, 22:29 Say: [Reply]

53
12/19 2008, 22:37 Say: [Reply]

54
12/20 2008, 22:43 Say: [Reply]

55
12/21 2008, 22:54 Say: [Reply]

56
12/22 2008, 23:29 Say: [Reply]

57
12/23 2008, 22:16 Say: [Reply]

58
12/24 2008, 22:34 Say: [Reply]

59
12/27 2008, 23:47 Say: [Reply]

60
SM 12/28 2008, 22:47 Say: [Reply]

61
12/29 2008, 22:20 Say: [Reply]

62
01/01 2009, 00:19 Say: [Reply]

63
01/01 2009, 23:43 Say: [Reply]

64
01/02 2009, 22:40 Say: [Reply]

65
01/05 2009, 00:34 Say: [Reply]

66
01/06 2009, 02:36 Say: [Reply]

67
01/07 2009, 02:20 Say: [Reply]

Add comment

© Fly our dream, All rights reserved.