--- services.old 2012-11-18 12:43:59.000000000 -0500 +++ services 2012-11-18 13:32:19.668831510 -0500 @@ -18,9 +18,10 @@ linux_copy_init_script(){ local full_init_script_path="$1/$2" if [ ! -e "$full_init_script_path" ]; then - ln -s "$(full_path $base_path)/${platform_path}/${2}" "$full_init_script_path" 2> /dev/null + ln -s "${platform_path}/${2}" "$full_init_script_path" 2> /dev/null local retval=$? [ $retval != 0 ] && log " !! Couldn't copy init script into ${1}!" + chmod +x "${platform_path}/${2}" return $retval fi return 0 @@ -73,11 +74,24 @@ [ $? == 0 ] && chkconfig --del $1 } +# We'll hijack arch's service load until upstreak adds a gentoo distro arch_load_service(){ - linux_copy_init_script '/etc/rc.d' $1 - [ $? == 0 ] && log " -- Prey network trigger has been copied to /etc/rc.d/$1. Remember to add it to /etc/rc.conf!" + linux_copy_init_script '/etc/init.d' $1 + rc-update add prey-trigger default } arch_unload_service(){ - linux_remove_init_script '/etc/rc.d' $1 + rc-update delete prey-trigger + linux_remove_init_script '/etc/init.d' $1 +} + +gentoo_load_service(){ + linux_copy_init_script '/etc/init.d' $1 + rc-update add prey-trigger default } + +gentoo_unload_service(){ + rc-update delete prey-trigger + linux_remove_init_script '/etc/init.d' $1 +} +