Project

General

Profile

[Solved] can't read lighttpd.conf file on mount device

Added by jery0711 over 9 years ago

Hi,dear.i want to know whether the lighttpd server can read config file on mount device such as a hard disk /dev/sda(ntfs fs)?

i porting lighttpd1.4.35 to my board use linux 3.10, cross compile is msdk-linux(mips,uclibc,4.4.7).

the lighttpd copy to root fs /tmp and star service use /tmp/lighttpd/sbin/lighttpd -f /tmp/lighttpd/config/lighttpd.conf can successful ,php display normal.

if i copy lighttpd to a mount device ,dir is /tmp/sda2/, use /tmp/sda2/lighttpd/sbin/lighttpd -f /tmp/sda2/lighttpd/config/lighttpd.conf then
" (configfile.c.1003) opening configfile /tmp/sda2/lighttpd/config/lighttpd.conf failed: No such device"

xsendfile also has the porblem, if i use /tmp/sda2/xxx.txt in php download the file can't download,if i copy the txt file to /tmp then can download.


Replies (4)

RE: can't read lighttpd.conf file on mount device - Added by nitrox over 9 years ago

Sounds like a permission problem on /sda2/, if you´re sure it isn´t, try "strace -fF -s 2048 -l foo /tmp/sda2/lighttpd/sbin/lighttpd -f /tmp/sda2/lighttpd/config/lighttpd.conf" and see foo.

RE: can't read lighttpd.conf file on mount device - Added by jery0711 over 9 years ago

nitrox wrote:

Sounds like a permission problem on /sda2/, if you´re sure it isn´t, try "strace -fF -s 2048 -l foo /tmp/sda2/lighttpd/sbin/lighttpd -f /tmp/sda2/lighttpd/config/lighttpd.conf" and see foo.

thanks nitrox.
but i don't think it's a permission problem.others program can execute on /sda2 dir.
i change the mount dir: /dev/sda2 to /tmp/usb/sda2.below:
cd /tmp/usb/
ls -la
drwxrwxrwx 4 root root 0 Oct 11 11:02 .
drwxr-xr-x 4 root root 0 Oct 11 11:15 ..
-rwxrwxrwx 1 root root 1 Oct 11 11:02 mnt_map
drwxrwxrwx 1 root root 4096 Oct 16 2014 sda1
drwxrwxrwx 1 root root 4096 Oct 11 2014 sda2
cd sda2/
ls -la
drwxrwxrwx 1 root root 4096 Oct 11 2014 .
drwxrwxrwx 4 root root 0 Oct 11 11:02 ..
drwxrwxrwx 1 root root 0 Oct 11 11:03 ftp
drwxrwxrwx 1 root root 4096 Oct 11 2014 lighttpd
-rwxrwxrwx 1 root root 2324480 Oct 11 2014 lighttpd.tar
drwxrwxrwx 1 root root 0 Oct 11 11:03 records
drwxrwxrwx 1 root root 0 Oct 11 11:03 videos
cd lighttpd/
ls -la
drwxrwxrwx 1 root root 4096 Oct 11 2014 .
drwxrwxrwx 1 root root 4096 Oct 11 2014 ..
drwxrwxrwx 1 root root 0 Oct 14 2014 cache
drwxrwxrwx 1 root root 0 Oct 14 2014 cgi-bin
drwxrwxrwx 1 root root 0 Oct 11 2014 config
drwxrwxrwx 1 root root 8192 Oct 11 2014 lib
drwxrwxrwx 1 root root 0 Oct 14 2014 log
drwxrwxrwx 1 root root 0 Oct 11 2014 sbin
drwxrwxrwx 1 root root 0 Oct 11 2014 share
drwxrwxrwx 1 root root 0 Oct 14 2014 sockets
drwxrwxrwx 1 root root 0 Oct 14 2014 upload
drwxrwxrwx 1 root root 0 Oct 14 2014 vhosts
drwxrwxrwx 1 root root 0 Oct 11 2014 webpages
ls -la
drwxrwxrwx 1 root root 0 Oct 11 2014 .
drwxrwxrwx 1 root root 4096 Oct 11 2014 ..
drwxrwxrwx 1 root root 4096 Oct 11 2014 conf.d
-rwxrwxrwx 1 root root 11856 Oct 17 2014 lighttpd.conf
-rwxrwxrwx 1 root root 3233 Oct 14 2014 modules.conf
pwd
/tmp/usb/sda2/lighttpd/sbin
./lighttpd -f /tmp/usb/sda2/lighttpd/config/lighttpd.conf
2014-10-11 13:18:52: (configfile.c.1003) opening configfile /tmp/usb/sda2/lighttpd/config/lighttpd.conf failed: No such device
my board linux shell don't has strace and then i porting it,the strace build failed with my mips uclibc cross toolchain(not buildroot)

i find buildroot gave a note:
strace: Disable for MIPS when using a uClibc toolchain
A change introduced in strace-4.9 makes it incompatible with MIPS
architecture when using a uClibc toolchain. This is the failure:

signal.c: In function 'printsiginfo':
signal.c:453:9: error: 'siginfo_t' has no member named 'si_timerid'
sip->si_timerid, sip->si_overrun);
^
signal.c:453:26: error: 'siginfo_t' has no member named 'si_overrun'
sip->si_timerid, sip->si_overrun);

uClibc needs to be patched in order to fix this problem. In the meantime
we disable strace for MIPS when using a uClibc toolchain.

thanks.

RE: [Solved] can't read lighttpd.conf file on mount device - Added by gstrauss about 7 years ago

If you can run lighttpd as root (comment out server.username and server.groupname in lighttpd.conf), but can not do so as a non-root user, then there is a permission problem on the mount, whether filesystem permissions, mount/automount permissions, or selinux/apparmor settings.

    (1-4/4)