Re: rtprio + su - doesn't work

2008-08-22 Thread Wojciech Puchar

tu run (at startup) asterisk PBX as user centrala with realtime priority.

asterisk is started, but without realtime priority.


Yes, you'd be running the su process with realtime priority.  :-)


and su forks shell and asterisk - isn't it?




how to do this right?

i run asterisk as user (not root), but this server is used to other things, 
so asterisk must have absolute priority over other things.

now i have to do this manually by searching for asterisk's PID and doing




rtprio 31 -PID


Well, you have to run rtprio as root, or else make it setuid-root (which 
probably isn't a great idea).  Presumably this thing has a startup script 
which runs it, and it probably creates a PID file under /var/run which you 
could use to adjust the priority during system startup via:


rtprio 31 -`cat /var/run/asterix.pid`


did this

/usr/bin/su centrala -c \
/usr/local/sbin/asterisk -C /centrala/etc/asterisk.conf
/bin/sleep 5
/usr/sbin/rtprio 31 -`cat /centrala/run/asterisk.pid`


works fine, but looks like workaround for me not proper solution?
am i wrong? thank you for explanation why it doesn't work directly

Wojtek
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: rtprio + su - doesn't work

2008-08-22 Thread Oliver Fromme
Wojciech Puchar  wrote:
  /usr/sbin/rtprio 31 /usr/bin/su centrala -c \
  /usr/local/bin/asterisk -C /centrala/etc/asterisk.conf
  
  asterisk is started, but without realtime priority.

I'm not sure what's wrong, but it works fine for me:

# rtprio 31 su -m nobody -c 'id; /usr/sbin/rtprio'
uid=65534(nobody) gid=65534(nobody) groups=65534(nobody)
rtprio: realtime priority 31
# 

This is on 7-stable (a few months old, though).

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH  Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

I have stopped reading Stephen King novels.
Now I just read C code instead.
-- Richard A. O'Keefe
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: rtprio + su - doesn't work

2008-08-22 Thread Wojciech Puchar


I'm not sure what's wrong, but it works fine for me:

# rtprio 31 su -m nobody -c 'id; /usr/sbin/rtprio'
uid=65534(nobody) gid=65534(nobody) groups=65534(nobody)
rtprio: realtime priority 31
#

This is on 7-stable (a few months old, though).


i have 7 stable too. no idea :)

maybe asterisk have something in it's code that drops that privilege.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: rtprio + su - doesn't work

2008-08-22 Thread Chuck Swiger

On Aug 22, 2008, at 6:28 AM, Wojciech Puchar wrote:
tu run (at startup) asterisk PBX as user centrala with realtime  
priority.

asterisk is started, but without realtime priority.


Yes, you'd be running the su process with realtime priority.  :-)


and su forks shell and asterisk - isn't it?


That's right.  RT priority isn't inherited by children processes, or  
so it seems.


[ ... ]
Well, you have to run rtprio as root, or else make it setuid-root  
(which probably isn't a great idea).  Presumably this thing has a  
startup script which runs it, and it probably creates a PID file  
under /var/run which you could use to adjust the priority during  
system startup via:


rtprio 31 -`cat /var/run/asterix.pid`


did this

/usr/bin/su centrala -c \
/usr/local/sbin/asterisk -C /centrala/etc/asterisk.conf
/bin/sleep 5
/usr/sbin/rtprio 31 -`cat /centrala/run/asterisk.pid`

works fine, but looks like workaround for me not proper solution?
am i wrong? thank you for explanation why it doesn't work directly


Very few people do anything with RT priorities, in part because Unix  
was designed to maximize workload throughput originally in a batch- 
processing context.  People who need hard realtime tend to use more  
specialized systems and hardware designed for realtime tasks (ie,  
bounded interrupt service times and the like)...


--
-Chuck

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


rtprio + su - doesn't work

2008-08-21 Thread Wojciech Puchar

i run such command

/usr/sbin/rtprio 31 /usr/bin/su centrala -c \
/usr/local/bin/asterisk -C /centrala/etc/asterisk.conf

tu run (at startup) asterisk PBX as user centrala with realtime priority.

asterisk is started, but without realtime priority.

how to do this right?

i run asterisk as user (not root), but this server is used to other 
things, so asterisk must have absolute priority over other things.

now i have to do this manually by searching for asterisk's PID and doing

rtprio 31 -PID

thanks

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: rtprio + su - doesn't work

2008-08-21 Thread Chuck Swiger

On Aug 21, 2008, at 2:04 PM, Wojciech Puchar wrote:

i run such command

/usr/sbin/rtprio 31 /usr/bin/su centrala -c \
/usr/local/bin/asterisk -C /centrala/etc/asterisk.conf

tu run (at startup) asterisk PBX as user centrala with realtime  
priority.


asterisk is started, but without realtime priority.


Yes, you'd be running the su process with realtime priority.  :-)


how to do this right?

i run asterisk as user (not root), but this server is used to other  
things, so asterisk must have absolute priority over other things.
now i have to do this manually by searching for asterisk's PID and  
doing




rtprio 31 -PID


Well, you have to run rtprio as root, or else make it setuid-root  
(which probably isn't a great idea).  Presumably this thing has a  
startup script which runs it, and it probably creates a PID file  
under /var/run which you could use to adjust the priority during  
system startup via:


  rtprio 31 -`cat /var/run/asterix.pid`

--
-Chuck

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]