Eu fiz alguma coisa ao colar acidentalmente o '/ etc / inittab' no shell?

3

Ajude-me especialistas em Unix,

Estávamos fazendo uma verificação no sistema e eu entrei no shell (usando o PuTTY):
# more /etc/inittab .
Eu copiei o conteúdo da saída com intenções para colar tudo isso em um documento. Mas então acidentalmente eu cliquei com o botão direito do mouse e, em putty, isso significa PASTE, então colei tudo de volta no shell.

Eu estraguei algo muito ruim? Temo que o sistema não seja inicializado da próxima vez? Estou enlouquecendo, é um sistema de produção. Até agora tudo parece normal. O /etc/inittab ainda é o mesmo, mas temo que possa ter atrapalhado outra coisa que se revelará mais tarde.

# more /etc/inittab
init:3:initdefault:
ioin::sysinit:/sbin/ioinitrc >/dev/console 2>&1
tape::sysinit:/sbin/mtinit > /dev/console 2>&1
muxi::sysinit:/sbin/dasetup   </dev/console >/dev/console 2>&1 # mux init
stty::sysinit:/sbin/stty 9600 clocal icanon echo opost onlcr ixon icrnl ignpar </dev/systty
brc1::bootwait:/sbin/bcheckrc </dev/console >/dev/console 2>&1 # fsck, etc.
link::wait:/sbin/sh -c "/sbin/rm -f /dev/syscon;                        /sbin/ln /dev/systty /dev/syscon" >/dev/console
2>&1
cprt::bootwait:/sbin/cat /etc/copyright >/dev/syscon           # legal req
sqnc::wait:/sbin/rc </dev/console >/dev/console 2>&1           # system init
#powf::powerwait:/sbin/powerfail >/dev/console 2>&1            # powerfail
cons:123456:respawn:/usr/sbin/getty console console            # system console
#ttp1:234:respawn:/usr/sbin/getty -h tty0p1 9600
#ttp2:234:respawn:/usr/sbin/getty -h tty0p2 9600
#ttp3:234:respawn:/usr/sbin/getty -h tty0p3 9600
#ttp4:234:respawn:/usr/sbin/getty -h tty0p4 9600
#ttp5:234:respawn:/usr/sbin/getty -h tty0p5 9600
ems1::bootwait:/sbin/rm -f /etc/opt/resmon/persistence/runlevel4_flag
ems2::bootwait:/sbin/cat </dev/null >/etc/opt/resmon/persistence/reboot_flag
ems3:3456:wait:/sbin/sh -c "/usr/bin/touch /etc/opt/resmon/persistence/runlevel4_flag; /usr/bin/chmod 644 /etc/opt/resmo
n/persistence/runlevel4_flag"
ems4:3456:respawn:/etc/opt/resmon/lbin/p_client
#ups::respawn:rtprio 0 /usr/lbin/ups_mond -f /etc/ups_conf
a0:3:off:/usr/sbin/getty -h ttyd2a1 1200
a1:3:off:/usr/sbin/getty -h ttyd2a2 1200
#



E abaixo está a pasta:

# # more /etc/inittab
init:3:initdefault:
# init:3:initdefault:
stty::sysinit:/sbin/stty 9600 clocal icanon echo opost onlcr ixon icrnl ignpar </dev/systty
brc1::bootwait:/sbin/bcheckrc </dev/console >/dev/console 2>&1 # fsck, etc.
link::wait:/sbin/sh -c "/sbin/rm -f /dev/syscon;                        /sbin/ln /dev/systty /dev/syscon" >/dev/console
2>&1
cprt::bootwait:/sbin/cat /etc/copyright >/dev/syscon           # legal req
sqnc::wait:/sbin/rc </dev/console >/dev/console 2>&1           # system init
#powf::powerwait:/sbin/powerfail >/dev/console 2>&1            # powerfail
cons:123456:respawn:/usr/sbin/getty console console            # system console
#ttp1:234:respawn:/usr/sbin/getty -h tty0p1 9600
#ttp2:234:respawn:/usr/sbin/getty -h tty0p2 9600
#ttp3:234:respawn:/usr/sbin/getty -h tty0p3 9600
#ttp4:234:respawn:/usr/sbin/getty -h tty0p4 9600
#ttp5:234:respawn:/usr/sbin/getty -h tty0p5 9600
ems1::bootwait:/sbin/rm -f /etc/opt/resmon/persistence/runlevel4_flag
ems2::bootwait:/sbin/cat </dev/null >/etc/opt/resmon/persistence/reboot_flag
ems3:3456:wait:/sbin/sh -c "/usr/bin/touch /etc/opt/resmon/persistence/runlevel4_flag; /usr/bin/chmod 644 /etc/opt/resmo
n/persistence/runlevel4_flag"
ems4:3456:respawn:/etc/opt/resmon/lbin/p_client
#ups::respawn:rtprio 0 /usr/lbin/ups_mond -f /etc/ups_conf
a0:3:off:/usr/sbin/getty -h ttyd2a1 1200
a1:3:off:/usr/sbin/getty -h ttyd2a2 1200
sh: init:3:initdefault::  not found.
# ioin::sysinit:/sbin/ioinitrc >/dev/console 2>&1
# tape::sysinit:/sbin/mtinit > /dev/console 2>&1
# muxi::sysinit:/sbin/dasetup   </dev/console >/dev/console 2>&1 # mux init
# stty::sysinit:/sbin/stty 9600 clocal icanon echo opost onlcr ixon icrnl ignpar </dev/systty
sh: stty::sysinit:/sbin/stty:  not found.
# brc1::bootwait:/sbin/bcheckrc </dev/console >/dev/console 2>&1 # fsck, etc.
#               /sbin/ln /dev/systty /dev/syscon" >/dev/console                                                      <
sh: link::wait:/sbin/sh:  not found.
# 2>&1
# cprt::bootwait:/sbin/cat /etc/copyright >/dev/syscon           # legal req
sh: cprt::bootwait:/sbin/cat:  not found.
# sqnc::wait:/sbin/rc </dev/console >/dev/console 2>&1           # system init
# #powf::powerwait:/sbin/powerfail >/dev/console 2>&1            # powerfail
# cons:123456:respawn:/usr/sbin/getty console console            # system console
sh: cons:123456:respawn:/usr/sbin/getty:  not found.
# #ttp1:234:respawn:/usr/sbin/getty -h tty0p1 9600
# #ttp2:234:respawn:/usr/sbin/getty -h tty0p2 9600
# #ttp3:234:respawn:/usr/sbin/getty -h tty0p3 9600
# #ttp4:234:respawn:/usr/sbin/getty -h tty0p4 9600
# #ttp5:234:respawn:/usr/sbin/getty -h tty0p5 9600
# ems1::bootwait:/sbin/rm -f /etc/opt/resmon/persistence/runlevel4_flag
sh: ems1::bootwait:/sbin/rm:  not found.
# ems2::bootwait:/sbin/cat </dev/null >/etc/opt/resmon/persistence/reboot_flag
sh: ems2::bootwait:/sbin/cat:  not found.
# /persistence/runlevel4_flag; /usr/bin/chmod 644 /etc/opt/resmo                                                     <
> n/persistence/runlevel4_flag"
sh: ems3:3456:wait:/sbin/sh:  not found.
# ems4:3456:respawn:/etc/opt/resmon/lbin/p_client
sh: ems4:3456:respawn:/etc/opt/resmon/lbin/p_client:  not found.
# #ups::respawn:rtprio 0 /usr/lbin/ups_mond -f /etc/ups_conf
# a0:3:off:/usr/sbin/getty -h ttyd2a1 1200
sh: a0:3:off:/usr/sbin/getty:  not found.
# a1:3:off:/usr/sbin/getty -h ttyd2a2 1200
sh: a1:3:off:/usr/sbin/getty:  not found.
#
    
por rixz 30.11.2013 / 16:36

1 resposta

4

Did i messed up something really bad? I am afraid that the system won't boot next time?

Não e sim (ou seja, o sistema inicializará bem - ou, pelo menos, isso não criará um problema). Agora você pode ter alguns arquivos nomeados ímpares em seu diretório de trabalho atual (que você pode excluir agora), mas parece que a maioria foi rejeitada como comandos "não encontrados". inittab não é, na verdade, um script de shell, portanto, quaisquer linhas que façam algum sentido para o shell fazem isso simplesmente por coincidência.

Existem algumas coisas:

ems2::bootwait:/sbin/cat </dev/null >/etc/opt/resmon/persistence/reboot_flag

Você encontrou esse. Eu acho que seria um erro sem saída stdout, então o arquivo teria sido truncado para zero. No entanto, isso é o que faria quando fosse executado corretamente também; evidentemente, isso é apenas um nó de arquivo usado como sinalizador (isto é, sua existência indica algo, mas não tem conteúdo).

ems3:3456:wait:/sbin/sh -c "/usr/bin/touch /etc/opt/resmon/persistence/runlevel4_flag; /usr/bin/chmod 644 /etc/opt/resmon/persistence/runlevel4_flag"

O chmod no final desse pode ter sido executado, embora provavelmente não desde que seja citado - isso depende se a sua cut 'n' paste foi de algum lugar que introduziu uma nova linha com quebras de linha, produzindo, por exemplo:

runlevel4_flag; /usr/bin/chmod 644 /etc/opt/resmon/persistence/runlevel4_flag"

A parte depois do cólon seria um comando real, mas runlevel4_flag" não seria um arquivo real.

Tenha cuidado ao trabalhar como root. Somente faça isso se precisar. Se você não está trabalhando como superusuário, coisas assim não podem causar nenhum dano real.

    
por 30.11.2013 / 16:57

Tags