Page 13 of 26

Re: [App] libSoftPowerOff D/E/F/H

Posted: Thu Oct 08, 2015 9:00 pm
by TheTroll
One think a little bit strange though.
The very first call to the off.sh script does not kill oscam.
But if i kill it manually, on.sh and off.sh works as expected.

Have you noticed this ?

Re: [App] libSoftPowerOff D/E/F/H

Posted: Thu Oct 08, 2015 9:11 pm
by zoelechat
mmmh no, you might try to loop it, and see if it ends in being killed. I voluntarily don't use kill -9 for process to be killed "properly" (->save .ccache). Using something like:

Code: Select all

while [ "$(/mnt/bin/pgrep oscam-)" ] ; do
   kill $(/mnt/bin/pgrep oscam-)
   sleep 1
done

Re: [App] libSoftPowerOff D/E/F/H

Posted: Thu Oct 08, 2015 9:12 pm
by TheTroll
Yes i could try that :)

Re: [App] libSoftPowerOff D/E/F/H

Posted: Thu Oct 08, 2015 9:18 pm
by TheTroll
Ok I know why :)

When started from /mnt/etc/init.d, oscam is started as root.
But the script is invoked as "app" !

How do you manage that ?

Re: [App] libSoftPowerOff D/E/F/H

Posted: Thu Oct 08, 2015 9:22 pm
by TheTroll
Yeah this is very bad :) cmd_on runs oscam as "app" so all "root" oscam conf files are not editable etc ...

Re: [App] libSoftPowerOff D/E/F/H

Posted: Thu Oct 08, 2015 9:26 pm
by TheTroll
Here is how i fixed it :

change
$OSCAM_DIR/$BUILD -b -c $OSCAM_DIR -w 0
to
su app -c "$OSCAM_DIR/$BUILD -b -c $OSCAM_DIR -w 0"
in init script
and
chown app:app -R /mnt/opt/privateer/usr/bin/oscam/

Re: [App] libSoftPowerOff D/E/F/H

Posted: Thu Oct 08, 2015 9:27 pm
by zoelechat
Ah right, forgot that on H :D

You have to pipe to nc:

Code: Select all

echo "kill $(/mnt/bin/pgrep oscam-)" | /dtv/bin/nc localhost 2023
Simpler than your solution :)

Re: [App] libSoftPowerOff D/E/F/H

Posted: Thu Oct 08, 2015 9:29 pm
by TheTroll
oh ok :)
better solution

same thing goes for cmd_on i guess ?

Re: [App] libSoftPowerOff D/E/F/H

Posted: Thu Oct 08, 2015 9:31 pm
by zoelechat
yep :)

I thought I had told H specific case in 1st post, obviously no :D

Re: [App] libSoftPowerOff D/E/F/H

Posted: Thu Oct 08, 2015 9:32 pm
by TheTroll
But the solution to run oscam as "app" seems fine as well, don't you think ?