Hi David,
I appreciate the response.... but what should I do to fix this? I can't
run liquidsoap as root because it won't let me do that. I can run
liquidsoap as a regular user, but using this init script doesn't seem to
work.
I've tried the following:
Adding the liquidsoap user to my regular user group
Adding the liquidsoap user to the root group
Modifying the init script to use my regular user
chmod -R /var/run/liquidsoap
Commented out the pidfile definition and makepidfile
None of which worked.
I can even su liquidsoap and manually start my script with that user. I
am completely stumped.
Here's the init script:
#!/sbin/runscript
script=${RC_SVCNAME#*.}
scriptfile="/etc/liquidsoap/${script}.liq"
command=/usr/bin/liquidsoap
command_args="--daemon ${scriptfile}"
start_stop_daemon_args="--user liquidsoap:liquidsoap --nicelevel -15 "
pidfile="/var/run/liquidsoap/${script}.pid"
name=${RC_SVCNAME}
description="Liquidsoap deamon that obeys ${scriptfile}"
extra_commands="check"
description_check="Check and evaluate stream scripts without interupting
streaming."
depend() {
need localmount
use net
after alsasound icecast
}
_script_exists() {
if [ "${script}" = "${RC_SVCNAME}" ]; then
eerror "You have to create an init script for each stream script:"
eerror "ln -s liquidsoap /etc/init.d/liquidsoap.<script>"
eerror "where script refers to /etc/liquidsoap/<script>.liq"
return 1
fi
if [ ! -f "${scriptfile}" ]; then
eerror "${scriptfile} not found"
return 1
fi
}
check() {
_script_exists || return 1
einfo "Checking ${scriptfile}"
check_result=`$command --check-lib ${scriptfile}`
eend $? ${check_result}
return $?
}
start_pre() {
_script_exists || return 1
}
start() {
start-stop-daemon --start \
${start_stop_daemon_args} \
--make-pidfile --pidfile ${pidfile} \
--exec ${command} \
-- ${command_args}
}
I'd like to note that I had to modify the init script from the original
by adding --pidfile, because start() complained otherwise.
I'd really appreciate any help.
Thanks,
Damien
On 01/15/13 13:01, David Baelde wrote:
> Hi Damien,
>
> On Fri, Jan 11, 2013 at 5:04 PM, Damien Moody <[email protected]>
> wrote:
>> Fatal error: exception Sys_error("/var/run/liquidsoap/main.pid:
>> Permission denied") Raised at file "pervasives.ml", line 231,
>> characters 21-47
>>
>> ls -lh /run/liquidsoap:
>> -rw-r--r-- 1 root root 5 Jan 11 15:52 main.pid
> >From the init.d script, liquidsoap is ran as user liquidsoap (or at
> least, not as root) so the permissions you're showing are not enough.
>
>> Line 230-231 in /usr/lib64/ocaml/pervasives.ml is
>>
>> let open_out_gen mode perm name =
>> open_descriptor_out(open_desc name mode perm)
> There isn't much to it besides what the error already tells: this code
> opens a file for writing (open_out) and this fails for lack of
> permissions.
>
> Good luck,
------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users