Permissions change on /var/lib/asterisk/agi-bin on reload

When reloading, permissions on files within /var/lib/asterisk/agi-bin change from “-rwxrwxrwx 1 asterisk asterisk” to “-rwxrwx— 1 asterisk asterisk”, and as dial-parties is then unuseable, calls fail to reach extensions. Is there any reason this would be happening, and what can I do to change it? I am running FPBX 2.9.0.7 with Asterisk 1.8.

Please let me know if I can provide any additional information.

This appears to be a duplicate of this thread, where my configuration is almost identical to the OP:

http://www.freepbx.org/forum/freepbx/users/agi-files-permissions-change

There was no resolution to this. My httpd.conf is also set to user:asterisk group:asterisk. I have not tried changing owner to root, nor do i want to. Where do I set how the permissions are defined?

I have noticed, however, that there is one instance of httpd running as root:

root      4758  0.0  0.4 260768 12404 ?        Ss   Oct10   0:00 /usr/sbin/httpd
asterisk  4897  0.0  1.3 349720 42876 ?        S    Oct10   0:26 /usr/sbin/httpd
asterisk  4898  0.0  1.3 348228 41524 ?        S    Oct10   0:23 /usr/sbin/httpd
asterisk  4899  0.0  1.3 348696 41948 ?        S    Oct10   0:24 /usr/sbin/httpd
asterisk  4900  0.0  1.3 349060 42368 ?        S    Oct10   0:24 /usr/sbin/httpd
asterisk  4901  0.0  1.3 348716 41972 ?        S    Oct10   0:25 /usr/sbin/httpd
asterisk  4902  0.0  1.3 348716 41692 ?        S    Oct10   0:26 /usr/sbin/httpd
asterisk  4903  0.0  1.3 348712 42004 ?        S    Oct10   0:26 /usr/sbin/httpd
asterisk  4904  0.0  1.3 348740 41504 ?        S    Oct10   0:26 /usr/sbin/httpd
root     17935  0.0  0.0  61196   768 pts/2    S+   11:32   0:00 grep httpd

What DID change prior to this happening was that I added space to the LVM asterisk is on. I can’t think of why that would break things, but maybe someone has more insight than I do. Any thoughts?

More thoughts…

The instance running as root has state flag Ss; indicating that it is the session leader. Would this have some effect on the issue I am seeing?

I believe I missed a really important bit in the duplicate thread. Asterisk is running as root right now:

[root@telcosrv01 agi-bin]# ps aux | grep asterisk
root      3118  0.0  0.0  48472  2152 pts/2    Sl+  12:04   0:00 rasterisk rvvvv
root      4799  0.0  0.0  65948   604 ?        S    Oct10   0:00 /bin/sh /usr/sbin/safe_asterisk
root      4811  1.8  2.6 748836 82684 ?        Sl   Oct10  15:11 /usr/sbin/asterisk -f -vvvg -c
asterisk  4897  0.0  1.3 349720 42980 ?        S    Oct10   0:48 /usr/sbin/httpd
asterisk  4898  0.0  1.3 348716 41652 ?        S    Oct10   0:44 /usr/sbin/httpd
asterisk  4899  0.0  1.3 348696 41948 ?        S    Oct10   0:45 /usr/sbin/httpd
asterisk  4900  0.0  1.3 349060 42372 ?        S    Oct10   0:44 /usr/sbin/httpd
asterisk  4901  0.0  1.3 348716 41988 ?        S    Oct10   0:45 /usr/sbin/httpd
asterisk  4902  0.0  1.3 348716 42008 ?        S    Oct10   0:47 /usr/sbin/httpd
asterisk  4903  0.0  1.3 348712 42016 ?        S    Oct10   0:47 /usr/sbin/httpd
asterisk  4904  0.0  1.3 348740 41872 ?        S    Oct10   0:47 /usr/sbin/httpd
root     12551  0.0  0.0  61196   768 pts/1    S+   12:53   0:00 grep asterisk

I did not have this trouble before increasing the size of the LVM on the PBX. Everything loaded fine, applying settings did not change anything. Right now I just need to get asterisk running as asterisk; does anyone have any idea how I can revert this?

Just found something that may make a difference; /etc/sysconfig/asterisk has USER/GROUP commented out. I will enable them, and see how that changes things. If anyone has any thoughts on any negative side effects this may have, please let me know. As far as I can tell permissions are right everywhere; the issue is asterisk not being run as asterisk.

Uncommented those lines and asterisk is now running as asterisk. Clicking apply does not appear to break things; we will see if this stays true tomorrow during service.