Skript po startu nenaběhne

Skript po startu nenaběhne
« kdy: 06. 04. 2014, 23:50:20 »
Ahoj, snazim se rozbehnout script po startu a nedari se :(

Kód: [Vybrat]
root@CodeName:/etc/rc2.d# ln -s /etc/init.d/bench_SCRIPT.sh S21bench_SCRIPT

Link se mi vytvori spravne.v Inittab mam defaultni runlevel 2 takze to davam  do rc2.d. Po restartu se ale nic nestane. Skript se nespust, ve skriptu mam logovani vysledu benchmarku

Kód: [Vybrat]
#!/bin/bash

{
echo -n "kernel version: "; uname -r
echo -n "memory used(MB): "; free -m | cut -c26-29 | head -2 | tail -1
echo "------------------------------------------------------------------------------"
openssl speed md5 | tail -2
echo "------------------------------------------------------------------------------"
} >> $HOME/bench_LOG.txt

« Poslední změna: 07. 04. 2014, 13:00:51 od Petr Krčmář »


PCnity

  • *****
  • 706
    • Zobrazit profil
    • E-mail
Re:Skript po startu
« Odpověď #1 kdy: 07. 04. 2014, 01:01:57 »
A kde ma home ten skript? Co povie find na bench_LOG.txt? Overil si aktualny runlevel?

Re:Skript po startu nenaběhne
« Odpověď #2 kdy: 07. 04. 2014, 21:09:15 »
Nikde se nevytvoril... runlevel 2.
Kód: [Vybrat]
root@CodeName:/home/project2501# runlevel
N 2
root@CodeName:/home/project2501# find / -iname 'bench_LOG.txt'
root@CodeName:/home/project2501#

Ale toto je zajimave, pri instalaci sw mi to zaclo hlasit zajimave veci:
Kód: [Vybrat]
root@CodeName:/home/project2501# aptitude install pulseaudio
Následující částečně nainstalované balíky budou zkonfigurovány:
  pulseaudio pulseaudio-module-x11
Žádné balíky se nebudou instalovat, aktualizovat nebo odstraňovat.
0 balíků aktualizováno, 0 nově instalováno, 0 k odstranění a 5 neaktualizováno.
Potřebuji stáhnout 0 B archivů. Po rozbalení bude použito 0 B.
Nastavuji balík pulseaudio (2.0-6.1) …     
insserv: warning: script 'S21bench_SCRIPT.sh' missing LSB tags and overrides
insserv: warning: script 'bench_SCRIPT.sh' missing LSB tags and overrides
insserv: There is a loop at service rc.local if started
insserv: There is a loop between service rc.local and mountnfs-bootclean if started
insserv:  loop involving service mountnfs-bootclean at depth 11
insserv:  loop involving service mountnfs at depth 10
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: Max recursions depth 99 reached
insserv:  loop involving service nfs-common at depth 9
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: There is a loop between service rc.local and mountnfs if started
insserv: There is a loop between service rc.local and urandom if started
insserv:  loop involving service urandom at depth 6
insserv:  loop involving service mountall at depth 5
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv:  loop involving service rsyslog at depth 12
insserv:  loop involving service networking at depth 8
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv:  loop involving service mountall-bootclean at depth 7
insserv: There is a loop between service bench_SCRIPT.sh and mtab if started
insserv:  loop involving service mtab at depth 4
insserv:  loop involving service checkroot at depth 3
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: There is a loop between service rc.local and checkfs if started
insserv:  loop involving service checkfs at depth 6
insserv: There is a loop between service rc.local and mountdevsubfs if started
insserv:  loop involving service mountdevsubfs at depth 2
insserv:  loop involving service udev at depth 1
insserv: There is a loop at service bench_SCRIPT.sh if started
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv:  loop involving service hwclock at depth 4
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv:  loop involving service network-manager at depth 15
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: chyba při zpracovávání pulseaudio (--configure):
 podproces instalovaný post-installation skript vrátil chybový status 1
dpkg: nesplněné závislosti zamezily konfiguraci balíku pulseaudio-module-x11:
 pulseaudio-module-x11 závisí na pulseaudio; avšak:
  Balík pulseaudio zatím není zkonfigurován.

dpkg: chyba při zpracovávání pulseaudio-module-x11 (--configure):
 problém se závislostmi - nechávám nezkonfigurované
Při zpracování nastaly chyby:
 pulseaudio
 pulseaudio-module-x11
E: Sub-process /usr/bin/dpkg returned an error code (1)
Instalace balíku selhala. Zkouším obnovit:
Nastavuji balík pulseaudio (2.0-6.1) …
insserv: warning: script 'S21bench_SCRIPT.sh' missing LSB tags and overrides
insserv: warning: script 'bench_SCRIPT.sh' missing LSB tags and overrides
insserv: There is a loop at service rc.local if started
insserv: There is a loop between service rc.local and mountnfs-bootclean if started
insserv:  loop involving service mountnfs-bootclean at depth 11
insserv:  loop involving service mountnfs at depth 10
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: Max recursions depth 99 reached
insserv:  loop involving service nfs-common at depth 9
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: There is a loop between service rc.local and mountnfs if started
insserv: There is a loop between service rc.local and urandom if started
insserv:  loop involving service urandom at depth 6
insserv:  loop involving service mountall at depth 5
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv:  loop involving service rsyslog at depth 12
insserv:  loop involving service networking at depth 8
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv:  loop involving service mountall-bootclean at depth 7
insserv: There is a loop between service bench_SCRIPT.sh and mtab if started
insserv:  loop involving service mtab at depth 4
insserv:  loop involving service checkroot at depth 3
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: There is a loop between service rc.local and checkfs if started
insserv:  loop involving service checkfs at depth 6
insserv: There is a loop between service rc.local and mountdevsubfs if started
insserv:  loop involving service mountdevsubfs at depth 2
insserv:  loop involving service udev at depth 1
insserv: There is a loop at service bench_SCRIPT.sh if started
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv:  loop involving service hwclock at depth 4
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!
insserv:  loop involving service network-manager at depth 15
insserv: Starting bench_SCRIPT.sh depends on rc.local and therefore on system facility `$all' which can not be true!

insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: chyba při zpracovávání pulseaudio (--configure):
 podproces instalovaný post-installation skript vrátil chybový status 1
dpkg: nesplněné závislosti zamezily konfiguraci balíku pulseaudio-module-x11:
 pulseaudio-module-x11 závisí na pulseaudio; avšak:
  Balík pulseaudio zatím není zkonfigurován.

dpkg: chyba při zpracovávání pulseaudio-module-x11 (--configure):
 problém se závislostmi - nechávám nezkonfigurované
Při zpracování nastaly chyby:
 pulseaudio
 pulseaudio-module-x11
                                     
root@CodeName:/home/project2501#

JardaP .

  • *****
  • 11 064
    • Zobrazit profil
    • E-mail
Re:Skript po startu nenaběhne
« Odpověď #3 kdy: 07. 04. 2014, 21:59:47 »
A kde by se take mel vytvorit? Co je v promenne HOME? Pridejte si tam echo $HOME>>/tmp/nejaky_soubor a pak si to prectete. BTW, nemuzete si to pustit z rc.local?

Re:Skript po startu nenaběhne
« Odpověď #4 kdy: 07. 04. 2014, 23:09:33 »
A kde by se take mel vytvorit? Co je v promenne HOME? Pridejte si tam echo $HOME>>/tmp/nejaky_soubor a pak si to prectete. BTW, nemuzete si to pustit z rc.local?
Tak jsem si tam dal ceastu natvrdo bez promenne $HOME, a skrip se mi tam nevytvoril. Nevim k cemu je rc.local a jaky je rozdil mezi tim co chci pouzit ja. Nicmene by me zajimalo proc mi to nefunguje...


Jimm

Re:Skript po startu nenaběhne
« Odpověď #5 kdy: 07. 04. 2014, 23:57:07 »
rc.local se spustí vždy, rc2.d jen pokud dosáhneš 2. runlevelu... Ale Google by pomohl také...


A kde by se take mel vytvorit? Co je v promenne HOME? Pridejte si tam echo $HOME>>/tmp/nejaky_soubor a pak si to prectete. BTW, nemuzete si to pustit z rc.local?
Tak jsem si tam dal ceastu natvrdo bez promenne $HOME, a skrip se mi tam nevytvoril. Nevim k cemu je rc.local a jaky je rozdil mezi tim co chci pouzit ja. Nicmene by me zajimalo proc mi to nefunguje...

Re:Skript po startu nenaběhne
« Odpověď #6 kdy: 08. 04. 2014, 14:52:14 »
Takze sem se dozvedel ze tento zpusob funguval u starsich verzi Debiana. Kdyz budu chtit pridat scrip napr ve Wheezym musim pouzit "update-rc.d". A nebo to cele nejak vypnout, aby to slo po staru rucne tak jak to delam ted. Tj zatím vse co vím... az neco nagooglim a odskousim dam vedet.

Re:Skript po startu nenaběhne
« Odpověď #7 kdy: 08. 04. 2014, 16:04:03 »
Takze kdyby mel nekdoi zajem...
pridat odebrat skript pomoci update-rc.d: http://www.debuntu.org/how-to-managing-services-with-update-rc-d/
skript musi obsahovat info popsané zde(jen aby nehlasil insserv): https://wiki.debian.org/LSBInitScripts

Re:Skript po startu nenaběhne
« Odpověď #8 kdy: 09. 04. 2014, 16:13:21 »
Tak at delam co delam (http://www.debuntu.org/how-to-managing-services-with-update-rc-d/) nejde mi upravit poradi spusteni meho scriptu. Vzdy se mi presune na stejnou pozici napr S20 i presto ze davam prikazy:
Kód: [Vybrat]
# update-rc.d bench_SCRIPT.sh start 24 2 3 4 5 . stop 23 0 1 6

nebo treba
Kód: [Vybrat]
# update-rc.d bench_SCRIPT.sh defaults 24

Re:Skript po startu nenaběhne
« Odpověď #9 kdy: 15. 04. 2014, 20:58:28 »