[App] libSoftPowerOff D/E/F/H
Re: [App] libSoftPowerOff D/E/F/H
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 ?
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
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
I do NOT receive any PM. Please use forum.
Re: [App] libSoftPowerOff D/E/F/H
Yes i could try that 

Re: [App] libSoftPowerOff D/E/F/H
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 ?

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
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
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/
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
Ah right, forgot that on H 
You have to pipe to nc:
Simpler than your solution 

You have to pipe to nc:
Code: Select all
echo "kill $(/mnt/bin/pgrep oscam-)" | /dtv/bin/nc localhost 2023

I do NOT receive any PM. Please use forum.
Re: [App] libSoftPowerOff D/E/F/H
oh ok 
better solution
same thing goes for cmd_on i guess ?

better solution
same thing goes for cmd_on i guess ?
Re: [App] libSoftPowerOff D/E/F/H
yep 
I thought I had told H specific case in 1st post, obviously no

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

I do NOT receive any PM. Please use forum.
Re: [App] libSoftPowerOff D/E/F/H
But the solution to run oscam as "app" seems fine as well, don't you think ?