ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] свой init скрипт
@ 2008-07-18  5:57 Yury Konovalov
  2008-07-18  6:45 ` Sergey
  2008-07-18  7:02 ` Alexey I. Froloff
  0 siblings, 2 replies; 15+ messages in thread
From: Yury Konovalov @ 2008-07-18  5:57 UTC (permalink / raw)
  To: ALT Linux Community general discussions

Здравствуйте, All!
Хочу написать свой скрипт для определенных манипуляций, вот например:

[root@localhost rc.d]# cat /etc/init.d/script
#!/bin/sh
# chkconfig: 2345 99 01
# description: test
WITHOUT_RC_COMPAT=1
# source function library
. /etc/init.d/functions
start()
{
        echo "start" >> /test
        return 0
}
stop()
{
        echo "stop" >> /test
        return 0
}
case "$1" in
    start)
            start
            ;;
    stop)
            stop
            ;;
    *)
        msg_usage "${0##*/} {start|stop}"
        RETVAL=1
esac
exit $RETVAL

Далее его подключаем:

chkconfig --add script
chkconfig script on

[root@localhost rc.d]# chkconfig --list|grep script
script          0:off   1:off   2:on    3:on    4:on    5:on    6:off

на всякий случай проверяем:
[root@localhost rc.d]# find /etc/rc.d/ -iname *script
/etc/rc.d/rc4.d/S99script
/etc/rc.d/rc0.d/K01script
/etc/rc.d/rc5.d/S99script
/etc/rc.d/rc6.d/K01script
/etc/rc.d/rc2.d/S99script
/etc/rc.d/rc3.d/S99script
/etc/rc.d/init.d/script
/etc/rc.d/rc1.d/K01script

все симлинки есть. Так вот если руками его запускать/останавливать, то
в тестовом файле (/test) естесвенно
появляются записи типа start stop. А если ребутнуть комп, то только
start, т.е. он при выключении/перегрузке
не запускается. Что я делаю не так ?! :'-(

-- 
Best Regards, Yury Konovalov aka Speccyfan (2:453/53)
Registered Linux User #379588

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-07-19 17:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-18  5:57 [Comm] свой init скрипт Yury Konovalov
2008-07-18  6:45 ` Sergey
2008-07-18  6:58   ` Alexey I. Froloff
2008-07-18  7:27     ` Sergey
2008-07-18  7:48       ` Michael Shigorin
2008-07-18  7:53         ` Yury Konovalov
2008-07-18  7:58           ` Michael Shigorin
2008-07-18  9:16           ` Mikhail Kuligin
2008-07-18  9:19             ` Alexey I. Froloff
2008-07-18  9:25             ` Yury Konovalov
2008-07-18  7:56         ` Sergey
2008-07-18  9:01           ` Yury Konovalov
2008-07-19 17:19             ` Sergey
2008-07-18  8:00       ` Sergey
2008-07-18  7:02 ` Alexey I. Froloff

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git