KillingSpark/rustysd

rustysd options like custom unitfiles directory?

pwFoo opened this issue · 10 comments

pwFoo commented

I moved rustysd to /usr/sbin/ and would like to move the unitfiles to /etc/unitfiles for example.
Is there a documentation about maybe existing options? Haven't found in rustysd.rs source file.

So currently you can use a config file (see config/rustysd_config.toml). The path to that must be given with the -c / --config argument. In the future the default path should be something like /etc/rustysd_config.toml but for now it's "./config/rustysd_config.toml"

Or you could of course edit the default path in src/config.rs to be /etc/rustysd_config.toml if you'd like :D

pwFoo commented

Possibility to configure some paths would be great!
At the moment all directories need to be at "/".

  • /unitfiles ( -> /etc)
  • /notifications ( -> /var/run ?)

For the moment it's ok and works fine (if needed with symlink to the directories)

You mean something like a "runtime_dir" cinfoguration/argument?

pwFoo commented

Different config options / arguments like -unitfiles_dir=/etc/unitfiles oder -unitfiles_dir=/etc/rustysd/units instead of hardcoded(?) ./unitfiles/ or -socket_dir=/var/run/rustysd instead of ./notifications.

Would be nice to have configurable directories and files.

I honestly forgot I already had these implemented in the config. Do you use a rustysd_config.toml? You can specify a path to it with the "-c" "--config" cli args.

So rustysd -c /etc/rustysd will load a rustysd_config.toml from this directory. In this you can specify

  1. notifications_dir to point to any directory which will contain all notification sockets
  2. unit_dirs which you can point to a number of directories to load unit files from

See config/rustysd_config.toml for examples :)

pwFoo commented

unit_dir, notifications_dir works fine! Thanks!

pwFoo commented

rustysd isn't log to a own file. Isn't implemented yet?

logging_dir = "/var/log"
log_to_stdout = false
log_to_disk = true
notifications_dir = "var/run/rustysd"
unit_dirs = [ "etc/unitfiles" ]
target_unit = "default.target"

Do I need to set a file to logging_dir?
Services logging to /var/log/<SERVICE_NAME>.log by unitfile option. But rustysd itself isn't logging to a file.

This is a leftover from when this was implemented. But it was not good enough, so i removed that feature again

pwFoo commented

I removed the options and redirect the stdout / stderr to /var/log/rustysd.log.
Ok for the moment 👍