KillingSpark / rustysd

A service manager that is able to run "traditional" systemd services, written in rust
MIT License
500 stars 15 forks source link

rustysd options like custom unitfiles directory? #18

Closed pwFoo closed 4 years ago

pwFoo commented 4 years ago

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.

KillingSpark commented 4 years ago

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"

KillingSpark commented 4 years ago

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 4 years ago

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

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

KillingSpark commented 4 years ago

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

pwFoo commented 4 years ago

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.

KillingSpark commented 4 years ago

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 4 years ago

unit_dir, notifications_dir works fine! Thanks!

pwFoo commented 4 years ago

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/.log by unitfile option. But rustysd itself isn't logging to a file.

KillingSpark commented 4 years ago

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

pwFoo commented 4 years ago

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