coova / coova-chilli

CoovaChilli is an open-source software access controller for captive portal hotspots.
Other
516 stars 258 forks source link

Chilli process cannot write to status file when not run as root #472

Open tomlloydveea opened 5 years ago

tomlloydveea commented 5 years ago

Scenario: When running the chilli process as a non root user the following output is seen when trying to start and stop the chilli process when using the status file for client tracking:

/usr/sbin/chilli --tundev tun0 --module tun --pidfile /var/run/chilli/chilli.pid --usestatusfile /var/run/chilli/chilli.status --statusfilesave --conf /etc/chilli.conf --uid 101 (chilli) --gid 102 (chilli)- Expected Behaviour: The process starts and create a chilli process with the corresponding status file.

Actual Behaviour: When creating the status file: No File or Directory: chiili.status

chilli[456]: printstatus(322): Writing status file: /tmp/chilli.status chilli[456]: Permission denied: could not open file /tmp/chilli.status chilli[456]: Permission denied: could not save status file

Then I touched /var/run/chilli/chilli.status and this when starting and stopping the process. I tried with all combinations of root/chilli ownership/groups with all variations of permissions on the file. chilli[12262]: Bad file descriptor: write(-1, 1)

When asking the process to terminate it will hang and my script will eventually kill the process. daemon.err chilli[11443]: Bad file descriptor: write(-1, 1) ERROR: chilli Sending KILL Signal as the process did not exit.

No status data is written to the file.

When the process is started as root and is not set to change to the chilli user the status file is created and written to as expected.