Matt Gibson
2004-Nov-14 20:30 UTC
[Asterisk-Users] Linux Kernel 2.6 Questions - safe_asterisk and udev
Hi All, A new server we have installed requires 2.6 for the sata hardware to work properly, so I've been somewhat forced into using Kernel 2.6 for now and having jumped right into it, it's quite nice, but I am having some small issues. I have it all up and running, and it seems somewhat faster on 2.6 (might just be the hype, who knows).. Anyway, I have a few questions. 1. Has anyone set asterisk up successfully with kernel 2.6 and running it as a user as opposed to root? - So far I have noticed that because of the udev file system, I have to manually chown /dev/zap /dev/sound et all to asterisk user upon boot up in rc.local. Is there a cleaner way of doing this? 2. I've also noticed that in rc.local I had to add a sleep 10 statement after inserting the modules to ensure that /dev/zap was created before running asterisk. Else asterisk would fail. Mind you this is running on a k6-350 with 320 megs of ram, so it could be the speed of the box, just wondering if anyone else noticed this. 3. When running safe_asterisk (su asterisk -c /usr/sbin/safe_asterisk) i see the following output --- ..root@asterisk:(~)%su asterisk -c /usr/sbin/safe_asterisk ..root@asterisk:(~)%Asterisk ended with exit status 0 Asterisk shutdown normally. but asterisk is running normally if I ps aux, and running as the user. Anyone know a way to fix this? I know it's not hurting anything, it's just annoying to see, and I'm sure it's not right. I looked at /usr/sbin/safe_asterisk, but can't figure out why it's doing that. I remember something about having to edit the path statement for the asterisk user in /etc/bashrc and/or /etc/profile and/or /etc/login.defs, all have been done, but this still doesn't seem to rectofy the problem. If anyone else has any other relevant 2.6 information, it'd be much abliged. ps: i'm using slackware 10.0, and kernel 2.6.9, and a tdm30b, and a x100p clone. thanks, Matt -- Matt Gibson VOIP Administrator NJ Tech Solutions 1.314.480.4550 ex. 6400 1.877.999.4678 ex. 6400
Kevin P. Fleming
2004-Nov-14 20:38 UTC
[Asterisk-Users] Linux Kernel 2.6 Questions - safe_asterisk and udev
Matt Gibson wrote:> 1. Has anyone set asterisk up successfully with kernel 2.6 and running > it as a user as opposed to root? - So far I have noticed that because of > the udev file system, I have to manually chown /dev/zap /dev/sound et > all to asterisk user upon boot up in rc.local. Is there a cleaner way of > doing this?Yes, read the udev documentation. You can control the permissions of any device node it creates using simple entries in its configuration files.> 2. I've also noticed that in rc.local I had to add a sleep 10 statement > after inserting the modules to ensure that /dev/zap was created before > running asterisk. Else asterisk would fail. Mind you this is running on > a k6-350 with 320 megs of ram, so it could be the speed of the box, just > wondering if anyone else noticed this.True. Device node creation is not synchronous with module loading in 2.6, the way it was in 2.4. You should not use a sleep statement, though, you should use a loop that waits until /dev/zap is created, at least for now. To do this properly requires using hotplug-driven scripts, but Asterisk is not currently capable of dealing with that.
Craig Guy
2004-Nov-14 21:51 UTC
[Asterisk-Users] Linux Kernel 2.6 Questions - safe_asterisk and udev
Running CVS Head 10 August on Kernel 2.6 (FC2) as non-root user with no issues. I followed the instructions on the wiki for running as non root. For startup and shutdown I've just copied the digium supplied scripts into /etc/rc.d/init.d and created the appropriate links into /etc/rc.d/rc3.d as appropriate. Craig ----- Original Message ----- From: "Matt Gibson" <gibson@experthost.com> To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users@lists.digium.com> Sent: Monday, November 15, 2004 11:30 AM Subject: [Asterisk-Users] Linux Kernel 2.6 Questions - safe_asterisk and udev> Hi All, > > A new server we have installed requires 2.6 for the sata hardware to > work properly, so I've been somewhat forced into using Kernel 2.6 for > now and having jumped right into it, it's quite nice, but I am having > some small issues. I have it all up and running, and it seems somewhat > faster on 2.6 (might just be the hype, who knows).. Anyway, I have a few > questions. > > 1. Has anyone set asterisk up successfully with kernel 2.6 and running > it as a user as opposed to root? - So far I have noticed that because of > the udev file system, I have to manually chown /dev/zap /dev/sound et > all to asterisk user upon boot up in rc.local. Is there a cleaner way of > doing this? > > 2. I've also noticed that in rc.local I had to add a sleep 10 statement > after inserting the modules to ensure that /dev/zap was created before > running asterisk. Else asterisk would fail. Mind you this is running on > a k6-350 with 320 megs of ram, so it could be the speed of the box, just > wondering if anyone else noticed this. > > 3. When running safe_asterisk (su asterisk -c /usr/sbin/safe_asterisk) i > see the following output --- > > ..root@asterisk:(~)%su asterisk -c /usr/sbin/safe_asterisk > ..root@asterisk:(~)%Asterisk ended with exit status 0 > Asterisk shutdown normally. > > but asterisk is running normally if I ps aux, and running as the user. > Anyone know a way to fix this? I know it's not hurting anything, it's > just annoying to see, and I'm sure it's not right. I looked at > /usr/sbin/safe_asterisk, but can't figure out why it's doing that. I > remember something about having to edit the path statement for the > asterisk user in /etc/bashrc and/or /etc/profile and/or /etc/login.defs, > all have been done, but this still doesn't seem to rectofy the problem. > > If anyone else has any other relevant 2.6 information, it'd be much > abliged. > > ps: i'm using slackware 10.0, and kernel 2.6.9, and a tdm30b, and a > x100p clone. > > > > thanks, > Matt > > -- > Matt Gibson > VOIP Administrator > NJ Tech Solutions > 1.314.480.4550 ex. 6400 > 1.877.999.4678 ex. 6400 > > > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >