Pixar Tractor startups for Gentoo, Homebrew or LFS

unfortunately we all don't use Redhat, and so the startup files for tractor wont run. Here is my own startup scripts for Pixar's Tractor tested on my own server and Gentoo.
first on the tractor-engine:

ln -s [path2engine]/admin/pixar /etc/conf.d/tractor-engine
and here is the tractor-engine script, save in /etc/init.d/tractor-engine.
#!/sbin/runscript
# Copyright 2010-2011 Nexus International LLC
# - Bernard Edlington

opts="reload"

depend() {
after PixarLicenseServer
}

prog="tractor-engine"
pidfile=/var/run/$prog.pid
# engineOPTIONS & engineDIR already defined in conf file
executable=$engineDIR/$prog

checkconfig() {
if [[ ! -x $executable ]] ; then
eerror "You need exec file "
return 1
fi
return 0
}

start() {
checkconfig || return $?
ebegin "Starting ${SVCNAME}"
start-stop-daemon --start \
--exec ${executable} \
-- --pidfile=/var/run/${prog}.pid \
--daemon ${engineOPTIONS}
eend $?
}

stop() {
ebegin "Stopping ${SVCNAME}"
start-stop-daemon --stop --quiet \
--exec ${executable} \
--pidfile /var/run/${prog}.pid
eend $?
}

reload() {
ebegin "Reloading ${SVCNAME}"
start-stop-daemon --stop --quiet \
--exec ${executable} \
--pidfile /var/run/${prog}.pid
sleep 1
start-stop-daemon --start \
--exec ${executable} \
-- --pidfile=/var/run/${prog}.pid \
--daemon ${engineOPTIONS}
eend $?
}
make sure to:
chmod +x /etc/init.d/tractor-engine
if you want to have this start at boot
rc-update add tractor-engine default
for the blade:
ln -s [path2blade]/admin/pixar /etc/conf.d/tractor-blade
and here is the tractor-blade script, save in /etc/init.d/tractor-blade
#!/sbin/runscript
# Copyright 2010-2011 Nexus International LLC
# - Bernard Edlington
opts="reload"

depend() {
after PixarLicenseServer
}

prog="tractor-blade"
pidfile=/var/run/$prog.pid
# bladeDIR already defined in conf file
executable=$bladeDIR/$prog
bladeOptions="--daemon --debug --log \
$bladeLOGFILE --pidfile=/var/run/${prog}.pid "

checkconfig() {
if [[ ! -x $executable ]] ; then
eerror "You need exec file "
return 1
fi
return 0
}

start() {
checkconfig || return $?
ebegin "Starting ${SVCNAME}"
start-stop-daemon --start \
--user ${bladeOWNER} \
--exec ${executable} -- \
${bladeOptions}
#eend $? # bug!! blade always returns 1
eend 0
}

stop() {
ebegin "Stopping ${SVCNAME}"
start-stop-daemon --stop --quiet \
--exec ${executable} \
--pidfile /var/run/${prog}.pid
eend $?
}

reload() {
ebegin "Reloading ${SVCNAME}"
start-stop-daemon --stop --quiet \
--exec ${executable} \
--pidfile /var/run/${prog}.pid
sleep 1
start-stop-daemon --start \
--chuid ${bladeOWNER} \
--exec ${executable} -- \
${bladeLOGFILE}
#eend $? # same here
eend 0
}
again make sure to:
chmod +x /etc/init.d/tractor-blade
if you want to have this start at boot
rc-update add tractor-blade default

2 Comments

  • February 14, 2011 at 8:03 AM | Permalink

    Thanks for sharing!

  • June 18, 2011 at 9:47 PM | Permalink

    nice sharing
    I will definitely be recommending it to my readers.

    Mohit Baghel
    http://freedomit26.com