From: "Yury Konovalov" <speccyfan@gmail.com> To: "ALT Linux Community general discussions" <community@lists.altlinux.org> Subject: [Comm] свой init скрипт Date: Fri, 18 Jul 2008 08:57:45 +0300 Message-ID: <99785b730807172257lbf8a819m9614536bf1366741@mail.gmail.com> (raw) Здравствуйте, 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
next reply other threads:[~2008-07-18 5:57 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-07-18 5:57 Yury Konovalov [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=99785b730807172257lbf8a819m9614536bf1366741@mail.gmail.com \ --to=speccyfan@gmail.com \ --cc=community@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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