› Forums › Network Management › ZeroShell › Disabling serial console to allow serial port to be used.
- This topic is empty.
-
AuthorPosts
-
February 12, 2009 at 2:55 pm #41469
gcams
MemberI have a fairly unusual setup, in that I want to use my Zeroshell ALIX box to pull info from the serial device using a bash script (I have the Alix 1D with VGA console and therefore don’t need a serial console). I note that inittab spawns a serial console which is preventing me from using the serial port for other purposes.
Is it possible to disable this somehow? I have tried modifying the inittab file, but as it’s pulled from the cdrom image, it get’s re-written on reboot. Is there a way to make this a permanent change?
Any advise or help most gratefully appreciated!
February 14, 2009 at 10:57 am #47607imported_fulvio
ParticipantTo disable the serial console after the boot you have to comment the line
7:2345:respawn:/sbin/agetty -i -n -l /root/kerbynet.cgi/scripts/localman 38400 ttyS0
in the file /etc/inittab
and execute the command
init q
to re-examine it.
Regards
FulvioFebruary 14, 2009 at 1:32 pm #47608gcams
MemberThanks fulvio, that’s a big help! Much appreciated!!
April 27, 2010 at 12:38 am #47609Larry Baker
MemberFulvio,
It looks to me like the solution you have given here does not survive a reboot. Is there a procedure to make this change permanent? (I tried to edit a copy of /etc/inittab in /Database/etc/inittab, but that did not work.)
Larry Baker
April 27, 2010 at 12:39 am #47610Larry Baker
MemberFulvio,
It looks to me like the solution you have given here does not survive a reboot. Is there a procedure to make this change permanent? (I tried to edit a copy of /etc/inittab in /Database/etc/inittab, but that did not work.)
Larry Baker
April 27, 2010 at 6:47 am #47611ppalias
MemberHi Larry,
for every change in ZS to be made effective after reboot you have to install it in “System” -> “Setup” -> “Startup/Cron” -> “PreBoot”.
In that field write the commandcp /Database/etc/inittab /etc/inittab
April 29, 2010 at 11:37 pm #47612Larry Baker
MemberIn the SYSTEM > Setup page, select the Startup/Cron tab.
Select the Post Boot script from the pull-down menu
Edit the Post Boot script:
>>> SNIP <<<
# Startup Script# Disable the COM1 serial port console
[ -f /etc/inittab.original ] || cp /etc/inittab{,.original}
/etc/inittab
sed /agetty.*localman.*ttyS0$/s/^/#/
telinit q>>> SNIP <<<
Select Status: Enabled
Select Save
Reboot.
April 29, 2010 at 11:41 pm #47613Larry Baker
MemberMy posts seem to be getting garbled. The line starting with </etc should be
/etc/inittab
April 29, 2010 at 11:44 pm #47614Larry Baker
MemberThis is very frustrating. For some reason, the line will not post correctly. The script redirects the sed command’s stdin to /etc/inittab.original and stdout to /etc/inittab.
April 30, 2010 at 6:36 am #47615ppalias
MemberUse the “Code” tags to display the shell code properly. However I think the solution to just copy the inittab in the preboot is more simple.
April 30, 2010 at 6:50 am #47616Larry Baker
MemberThank you for the suggestion to use the Code tags. I did not expect the posting to get mangled (the Preview was correct).
I wrote the code to make a copy of the original inittab and used sed the way I did so that the code would work with any version of ZeroShell that might be released. If inittab changes, I expect this code will still work.
March 21, 2014 at 2:04 am #47617tls
MemberThe code did not exactly work for me, so I make it a little cleaner, thus building on your idea:
[ -f /etc/inittab.original ] || cp /etc/inittab{,.original}
sed -i 's/(^.*ttyS0.*$)/#1/' /etc/inittab
telinit q
Many thanks for posting the initial issue – I had the same problem, wanted to ttyS0 to hook into my edge switch on the serial line so I could always get to my systems.
–tls
-
AuthorPosts
- You must be logged in to reply to this topic.