|
Компьютерный форум OSzone.net » Linux и FreeBSD » Общий по Linux » Стартовые сценарии |
|
|
Стартовые сценарии
|
Ветеран Сообщения: 551 |
Имеется следующая проблема: слака 9.0, не производится нормальная перезагрузка и выключение
системы. Выдается следующее: INIT: Sending processes TERM signal INIT: Sending processes KILL signal INIT: cannot execute /etc/rc.d/rc.0:/sbin/poweroff (/sbin/reboot) Содержимое /etc/rc.d/rc.0 (rc.6) #Set the path. PATH=/sbin:/etc:/bin:/usr/bin # If there are SystemV init scripts for this runlevel, run them. if [ -x /etc/rc.d/rc.sysvinit ]; then . /etc/rc.d/rc.sysvinit fi # Set linefeed mode to avoid staircase effect. stty onlcr echo "Running shutdown script $0:" # Find out how we were called. case "$0" in *0) command="halt" echo "HALT" ;; *6) command=reboot ;; *) echo "$0: call me as \"rc.0\" or \"rc.6\" please!" exit 1 ;; esac # Save the system time to the hardware clock using hwclock --systohc. # Detect SGI Visual Workstation, since hwclock will make those freeze up: if fgrep -l Cobalt-APIC /proc/interrupts 1> /dev/null 2> /dev/null ; then echo "SGI Visual Workstation detected. Not running hwclock." elif [ -x /sbin/hwclock ]; then if grep "^UTC" /etc/hardwareclock 1> /dev/null 2> /dev/null ; then echo "Saving system time to the hardware clock (UTC)." /sbin/hwclock --utc --systohc else echo "Saving system time to the hardware clock (localtime)." /sbin/hwclock --localtime --systohc fi fi # Stop the Apache web server: echo "Stopping Apache server" if [ -x /etc/rc.d/rc.httpd ]; then /etc/rc.d/rc.httpd stop fi # Stop the Samba server: echo "Stopping Samba server" if [ -x /etc/rc.d/rc.samba ]; then . /etc/rc.d/rc.samba stop fi # Shut down the NFS server: echo "Shutting down NFS server" if [ -x /etc/rc.d/rc.nfsd ]; then /etc/rc.d/rc.nfsd stop fi # Unmount any NFS or SMB filesystems: echo "Unmounting remote filesystems." umount -a -r -t nfs,smbfs # Stopping vmware services echo "Stopping VMware services" if [ -x /etc/rc.d/rc.vmware_stop ]; then exec /etc/rc.d/rc.vmware_stop stop fi # Try to kill dhcpcd so the DHCP leases can be returned: killall -15 dhcpcd 1> /dev/null 2> /dev/null # Shut down PCMCIA devices: if [ -x /etc/rc.d/rc.pcmcia ] ; then . /etc/rc.d/rc.pcmcia stop # The cards might need a little extra time here to initialize. sleep 5 fi # Turn off process accounting: if [ -x /sbin/accton -a -r /var/log/pacct ]; then echo "Turning off process accounting." /sbin/accton fi # Kill all processes. # INIT is supposed to handle this entirely now, but this didn't always # work correctly without this second pass at killing off the processes. # Since INIT already notified the user that processes were being killed, # we'll avoid echoing this info this time around. if [ "$1" != "fast" ]; then # shutdown did not already kill all processes killall5 -15 sleep 5 killall5 -9 fi # Try to turn off quota: if fgrep quota /etc/fstab 1> /dev/null 2> /dev/null ; then if [ -x /sbin/quotaoff ]; then echo "Turning off filesystem quotas." /sbin/quotaoff -a fi fi # Before unmounting file systems write a reboot or halt record to wtmp. $command -w # Carry a random seed between reboots. # Save 512 bytes, which is the size of the entropy pool. echo "Saving random seed from /dev/urandom in /etc/random-seed." dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2> /dev/null # Clear /var/lock/subsys. if [ -d /var/lock/subsys ]; then rm -f /var/lock/subsys/* fi # Turn off swap, then unmount local file systems. echo "Turning off swap." swapoff -a echo "Unmounting local file systems." # Don't remount UMSDOS root volumes: if [ ! "`mount | head -1 | cut -d ' ' -f 5`" = "umsdos" ]; then umount -a -r -t nonfs echo "Remounting root filesystem read-only." mount -n -o remount,ro / else umount -a -r -t nonfs,noumsdos,nosmbfs fi # This never hurts: sync # If we're using LVM, we need to deactivate the volume groups: if [ -r /etc/lvmtab ]; then /sbin/vgchange -an fi # sleep 1 fixes problems with some hard drives that don't # otherwise finish syncing before reboot or poweroff sleep 1 # This is to ensure all processes have completed on SMP machines: wait if [ -x /sbin/genpowerd ]; then # See if this is a powerfail situation: if grep FAIL /etc/upsstatus 1> /dev/null 2> /dev/null ; then # Signal UPS to shut off the inverter: /sbin/genpowerd -k /dev/ttyS4 tripp-nt if [ ! $? = 0 ]; then echo echo "There was an error signaling the UPS." echo "Perhaps you need to edit /etc/rc.d/rc.6 to configure" echo "the serial line and UPS type." # Wasting 15 seconds of precious power: sleep 15 fi fi fi Содержимое /etc/inittab: # # inittabThis file describes how the INIT process should set up #the system in a certain run-level. # # Version:@(#)inittab2.0417/05/93MvS # 2.10 02/10/95 PV # 3.00 02/06/1999 PV # 4.00 04/10/2002 PV # # Author:Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org> # Modified by:Patrick J. Volkerding, <volkerdi@slackware.com> # # These are the default runlevels in Slackware: # 0 = halt # 1 = single user mode # 2 = unused (but configured the same as runlevel 3) # 3 = multiuser mode (default Slackware runlevel) # 4 = X11 with KDM/GDM/XDM (session managers) # 5 = unused (but configured the same as runlevel 3) # 6 = reboot # Default runlevel. (Do not set to 0 or 6) id:4:initdefault: # System initialization (runs when system boots). si:S:sysinit:/etc/rc.d/rc.S # Script to run when going single user (runlevel 1). su:1S:wait:/etc/rc.d/rc.K # Script to run when going multi user. rc:2345:wait:/etc/rc.d/rc.M # What to do at the "Three Finger Salute". ca::ctrlaltdel:/sbin/shutdown -t5 -r now # Runlevel 0 halts the system. l0:0:wait:/etc/rc.d/rc.0:/sbin/shutdown -t5 -r now # Runlevel 6 reboots the system. l6:6:wait:/etc/rc.d/rc.6:/sbin/reboot # What to do when power fails. pf::powerfail:/sbin/genpowerfail start # If power is back, cancel the running shutdown. pg::powerokwait:/sbin/genpowerfail stop # These are the standard console login getties in multiuser mode: c1:1235:respawn:/sbin/agetty 38400 tty1 linux c2:1235:respawn:/sbin/agetty 38400 tty2 linux c3:1235:respawn:/sbin/agetty 38400 tty3 linux c4:1235:respawn:/sbin/agetty 38400 tty4 linux c5:1235:respawn:/sbin/agetty 38400 tty5 linux c6:12345:respawn:/sbin/agetty 38400 tty6 linux # Local serial lines: #s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100 #s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100 # Dialup lines: #d1:12345:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS0 vt100 #d2:12345:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS1 vt100 # Runlevel 4 used to be for an X window only system, until we discovered # that it throws init into a loop that keeps your load avg at least 1 all # the time. Thus, there is now one getty opened on tty6. Hopefully no one # will notice. ;^) # It might not be bad to have one text console anyway, in case something # happens to X. x1:4:wait:/etc/rc.d/rc.4 # End of /etc/inittab В чем может быть дело? |
|
------- Отправлено: 18:46, 09-10-2003 |
info man howto Сообщения: 6958
|
Профиль | Сайт | Отправить PM | Цитировать Цитата:
|
|
------- Отправлено: 21:22, 09-10-2003 | #2 |
Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети. Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля. |
Ветеран Сообщения: 551
|
Профиль | Отправить PM | Цитировать ruslandh
Конечно. Первым делом проверил. Вообще - какие-то непонятки: поначалу все было ОК, затем по прошествии какого-то времени стала появлятся эта ошибка. Я в сценарии только прописал загрузку VMware и hdparm-скрипт, но это уже после возникновения ошибки. И, главное, где копать не могу понять ![]() |
------- Отправлено: 19:34, 10-10-2003 | #3 |
info man howto Сообщения: 6958
|
Профиль | Сайт | Отправить PM | Цитировать А если дать просто команду
/sbin/shutdown -t5 -r now, то комп перегружается ? |
------- Отправлено: 21:03, 10-10-2003 | #4 |
Ветеран Сообщения: 551
|
Профиль | Отправить PM | Цитировать ruslandh
Забыл упомянуть: ни poweroff, ни reboot, ни shutdown не пашут- то же сообщение. Вообще все это похоже на проблему с init-уровнями... |
|
------- Отправлено: 17:32, 12-10-2003 | #5 |
Ветеран Сообщения: 551
|
Профиль | Отправить PM | Цитировать Что, никто не в курсе?
![]() |
------- Отправлено: 19:28, 14-10-2003 | #6 |
info man howto Сообщения: 6958
|
Профиль | Сайт | Отправить PM | Цитировать Dimon
Я не знаю ![]() Ничего криминального не нахожу, все приведённые настройки вроде правильные ![]() |
------- Отправлено: 20:41, 14-10-2003 | #7 |
Ветеран Сообщения: 551
|
Профиль | Отправить PM | Цитировать ruslandh
Анаологично ![]() |
------- Отправлено: 20:10, 15-10-2003 | #8 |
Старожил Сообщения: 335
|
Профиль | Сайт | Отправить PM | Цитировать Dimon
А под каким пользователем ьак происходит? Может, это с правами что-нибудь? |
------- Отправлено: 02:44, 16-10-2003 | #9 |
Ветеран Сообщения: 551
|
Профиль | Отправить PM | Цитировать Sean Ingumsky
А что под юзером, что под рутом - все едино... |
------- Отправлено: 11:21, 16-10-2003 | #10 |
|
![]() |
Участник сейчас на форуме |
![]() |
Участник вне форума |
![]() |
Автор темы |
![]() |
Сообщение прикреплено |
| |||||
Название темы | Автор | Информация о форуме | Ответов | Последнее сообщение | |
[решено] Сценарии Запуск/Завершение | Tele2 | Microsoft Windows NT/2000/2003 | 2 | 02-09-2008 20:47 | |
сценарии загрузки logon/logoff | Tonny_Bennet | Microsoft Windows NT/2000/2003 | 8 | 07-06-2008 01:14 | |
Сценарии в windows XP | yastreb_oren | Microsoft Windows NT/2000/2003 | 2 | 07-02-2008 09:18 | |
Сценарии в Win2000 и NT | J Fox | Microsoft Windows NT/2000/2003 | 6 | 01-11-2003 20:16 |
|