* Backend daemon drops privileges after initialization (to not run as root)

* New config option `CLICON_USER` with default value `clicon`
  * Can also be set with `-U <user>` clixon_backend command-line option
This commit is contained in:
Olof hagsand 2019-09-11 21:24:14 +02:00
parent 3806f7652e
commit 3d5abb77f9
60 changed files with 238 additions and 93 deletions

View file

@ -89,7 +89,7 @@ testrun(){
if [ $BE -ne 0 ]; then
new "Kill backend"
# Check if premature kill
pid=`pgrep -u root -f clixon_backend`
pid=$(pgrep -u $BUSER -f clixon_backend)
if [ -z "$pid" ]; then
err "backend already dead"
fi
@ -120,8 +120,11 @@ sudo rm -f $dir/startup_db;
new "Run without startup option, check running is copied"
testrun ""
new "Check startup should not exist"
if [ -f $dir/startup_db ]; then
err "startup should not exist"
new "Check startup is empty"
if [ ! -f $dir/startup_db ]; then
err "startup does not exist"
fi
if [ -s $dir/startup_db ]; then
err "startup is not empty"
fi
rm -rf $dir