Patrick Cervicek
2006-Jul-25 18:06 UTC
[asterisk-users] Change current working directory to /tmp
To get a core file, I started Asterisk with cd /tmp /usr/sbin/asterisk -g -p -U asterisk Unfortunately, asterisk always changes the cwd (current working directory) to '/' I checked that in /proc/.../cwd and with strace. I start asterisk as User 'asterisk', therefor it is not possible to write core dumps in /. How can I force asterisk to use /tmp as cwd? I have Debian Sarge with Asterisk 1.2.7.1
Patrick, I run asterisk in a chroot'ed environment and within it I cd into /tmp just before starting asterisk. The kernel happily dumps the core files into that /tmp directory. As far as I can tell, this behavior has not changed recently and it definitely worked for 1.2.7.1. You can also force a directory where core files should be dumped with: mkdir /corefiles echo /corefiles/core > /proc/sys/kernel/core_pattern The kernel will then dump all core files for any process into the /corefiles directory. --Luki On 7/25/06, Patrick Cervicek <patrick@cervicek.de> wrote:> To get a core file, I started Asterisk with > cd /tmp > /usr/sbin/asterisk -g -p -U asterisk > > Unfortunately, asterisk always changes the cwd (current working > directory) to '/' > I checked that in /proc/.../cwd and with strace. I start asterisk as > User 'asterisk', therefor it is not possible to write core dumps in /. > > How can I force asterisk to use /tmp as cwd? > > I have > Debian Sarge with Asterisk 1.2.7.1