Slackware 12 Guest no "daemon"

Discussions about using Linux guests in VirtualBox.
Post Reply
Erik_FL
Posts: 55
Joined: 8. Feb 2008, 06:46

Slackware 12 Guest no "daemon"

Post by Erik_FL »

I'm having a problem with the Linux Guest Additions in Slackware 12.0 because there is no "daemon" command. I get an error at line 154 in "vboxadd-timesync".

Does anyone know of an alternative to the "daemon" command that might work in Slackware?
Erik_FL
Posts: 55
Joined: 8. Feb 2008, 06:46

Post by Erik_FL »

In order to get the time-sync to work I had to define some functions that were missing in the "other" operating system case in "vboxadd-timesync".

Code: Select all

if [ "$system" = "other" ]; then
    daemon() {
        $* >/dev/null 2>&1
    }

    killproc() {
        pid=`pidof -s $1`
        if [ -n "$pid" ]; then
            kill $pid
        fi
    }
    fail_msg() {
        echo " ...fail!"
    }

    succ_msg() {
        echo " ...done."
    }

    begin() {
        echo -n "$1"
    }
fi
I added the "daemon" and "killproc" functions. They work for Slackware Linux but I'm not sure about other distros. In any case, the functions have to be present, so it won't break anything worse to define them if you have an "other" Linux distro.

I also noticed that "vboxadd-timesync start" does not work if the system is not properly shut down (without "vboxadd-timesync stop"). Once that happens it will never allow a "start" because it thinks that the process is already running.

To get around that problem I put both a "stop" and a "start" in my "/etc/rc.d/rc.local" startup script as follows.

Code: Select all

# VirtualBox additions
/etc/init.d/vboxadd start
/etc/init.d/vboxvfs start
/etc/init.d/vboxadd-timesync stop
/etc/init.d/vboxadd-timesync start
I also created an "/etc/rc.d/rc.local_shutdown" script to shut down "vboxadd-timesync". NOTE: Shutting down "vboxadd" isn't necessary and reports an error.

Code: Select all

# VirtualBox additions
/etc/init.d/vboxadd-timesync stop
/etc/init.d/vboxvfs stop
#/etc/init.d/vboxadd stop
giancarlo.devivo
Posts: 3
Joined: 15. Feb 2008, 17:26

Post by giancarlo.devivo »

Hi, it works!
Thanks
--
Giancarlo
Post Reply