LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   inetd script in /etc/init.d is running amuck (https://www.linuxquestions.org/questions/linux-newbie-8/inetd-script-in-etc-init-d-is-running-amuck-48790/)

int0x80 03-07-2003 09:12 PM

inetd script in /etc/init.d is running amuck
 
Preliminary: I'm running Debian 3.0 unstable

Somehow, inetd got installed on my laptop (that's a whole other rant because I did a base install and used apt-get for everything else). I just found out today that it's there (it wasn't there before) and tried to remove it with dpkg. It wouldn't uninstall, complained about dependencies or something, and I had to get ready for work. So I figured inetd is running at startup, I could just do something in /etc/init.d to kill or stop it. Sure enough there's an inetd script in /etc/init.d that takes a command line argument (start|stop|restart). So just before the very last line (which is an exit call), I put inetd stop. Now when I try to boot, it continually scrolls:

Stopping internet superserver: inetd.

Eventually it complains that all the memory has been used, and starts killing other processes. How can I get in there to fix this?

int0x80 03-07-2003 09:51 PM

Hey I fixed it!
 
I'm running LILO, so I selected which kernel image I wanted to boot, then typed init=/bin/bash

This eventually dropped me into a root shell with / mounted as read-only. I couldn't edit the /etc/init.d/inetd file at that point, so I remounted / in read-write mode with mount -n /proc then mount -o rw,remount /. Opened up the /etc/init.d/inetd again, took out the problematic line, and I was all set.

Still trying to figure out how to remove inetd with dpkg.. and also how the heck inetd got installed. Weird. Just thought I would share my solution in case anyone had a similar problem and came across this thread in the future.


[edit]: I also found this on the Debian site.

Code:

    #!/bin/sh
    # FIXME: this is quick and dirty; replace with a more robust script snippet
    for i in `sudo lsof -i | grep LISTEN | cut -d " " -f 1 |sort -u` ; do
            pack=`dpkg -S $i |grep bin |cut -f 1 -d : | uniq`
            echo "Service $i is installed by $pack";
            init=`dpkg -L $pack |grep init.d/ `
            if [ ! -z "$init" ]; then
                      echo "and is run by $init"
            fi
    done



All times are GMT -5. The time now is 02:23 PM.