]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
main: Warn about unexpected configuration location
authorOlliver Schinagl <oliver@schinagl.nl>
Sun, 13 Aug 2023 08:45:56 +0000 (10:45 +0200)
committerFlole998 <Flole998@users.noreply.github.com>
Fri, 2 Feb 2024 00:00:05 +0000 (01:00 +0100)
When using the `--fork` flag, and no user or config arguments are
supplied, the configuration folder will end up with whatever the default
`daemon` user has set, which is often `/sbin` set as the homedir.

This is weird, but not 'wrong' per say. Lets warn the user that forking
can have an unexpected side effect.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
src/main.c

index 3268ded52fe68e1a12735e05b1ac4cfff18f204f..306eee59595e65107adfc34afec830e685c2e15d 100644 (file)
@@ -1114,6 +1114,9 @@ main(int argc, char **argv)
   tvh_signal(SIGPIPE, handle_sigpipe); // will be redundant later
   tvh_signal(SIGILL, handle_sigill);   // see handler..
 
+  if (opt_fork && !opt_user && !opt_config)
+    tvhwarn(LS_START, "Forking without --user or --config may use unexpected configuration location");
+
   /* Set privileges */
   if((opt_fork && getuid() == 0) || opt_group || opt_user) {
     const char *homedir;