Slackware 12 Guest no "daemon"

Discussions about using Linux guests in VirtualBox.

Slackware 12 Guest no "daemon"

Postby Erik_FL » 21. Feb 2008, 04:20

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

Postby Erik_FL » 21. Feb 2008, 18:43

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   Expand viewCollapse view
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   Expand viewCollapse view
# 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   Expand viewCollapse view
# VirtualBox additions
/etc/init.d/vboxadd-timesync stop
/etc/init.d/vboxvfs stop
#/etc/init.d/vboxadd stop
Erik_FL
 
Posts: 55
Joined: 8. Feb 2008, 06:46

Postby giancarlo.devivo » 18. Mar 2008, 16:41

Hi, it works!
Thanks
--
Giancarlo
giancarlo.devivo
 
Posts: 3
Joined: 15. Feb 2008, 17:26


Return to Linux Guests

Who is online

Users browsing this forum: No registered users and 18 guests