-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
On Android 7, When running the following daemonize command runsvdir will fail.
daemonize -l $PREFIX/var/run/runsvdir.lock -p $PREFIX/var/run/runsvdir.pid $PREFIX/bin/applets/runsvdir /data/data/com.termux/files/home/.sv
Checking the logs reveals the following problem:
$ daemonize -vo ~/output -e ~/error -l $PREFIX/var/run/runsvdir.lock -p $PREFIX/var/run/runsvdir.pid $PREFIX/bin/applets/runsvdir /data/data/com.termux/files/home/.sv
$ cat error
runsvdir: /data/data/com.termux/files/home/.sv: fatal: can't open current directory: Permission denied
After a lot of testing I finally figured out the problem: Everything daemonize executes is run from the / directory (that's why it needs absolute paths). Starting with Android 7 / no longer has read permissions.
$ ls /
ls: cannot open directory '/': Permission denied
runsvdir, for some reason, needs read access to the current working directory.
Workaround
Specifing the working directory for daemonize fixes the problem
daemonize -c $PREFIX -l $PREFIX/var/run/runsvdir.lock -p $PREFIX/var/run/runsvdir.pid $PREFIX/bin/applets/runsvdir /data/data/com.termux/files/home/.sv
Perhaps daemonize could be patched to set the default working directory to $PREFIX