> > > > I prefer to add an EnvironmentFile like /etc/sysconfig/ndctl/monitor > > to systemd rather than add a configuration file. According to [1], > > environment variable substitution is supported in systemd.service, so > > we can define the variables through > "EnvironmentFile=/etc/sysconfig/ndctl/monitor". > > In this fashion, we do not need to add any extra codes to parse the > > configuration > file. > > > > In this case, [--conf-file] option is not necessary either. > > According to [2], sytemd units can be instantiated from a template > > file, thus we only need to add a template unit file in advance. > > If user wants to run multiple monitors with different configurations, > > they can differentiate them by adding multiple EnvironmentFiles, like > /etc/sysconfig/ndctl/<monitor1...n>. > > Then the monitors can be started by command like "# systemctl start > > ndctl-monitor@<monitor1...n>.service". > > > > When the monitors started by hand, it will do not need any > > configuration files, because we can add options and parameters directly. > > > > [1]https://www.freedesktop.org/software/systemd/man/systemd.service.ht > > ml > > [2]https://www.freedesktop.org/software/systemd/man/systemd.unit.html > > This seems to needlessly tie ndctl to systemd, it should be able to operate > without > requiring systemd. I expect it would be straightforward to copy the > configuration file > implementation from git.
I have read the configuration file implementation of git, my understanding is that git daemon does not have any options used to override default configuration. I want to confirm if the configuration file is only used for ndctl monitor. If yes, I do not think copy the configuration file implementation from git is a good choice, because only getting keys and values from configuration file is needed for us and the structure of configuration file implementation in git is too complexity. I prefer to borrow from udev[1], because the implementation in udev is simpler and it seems ndctl also borrows a lot from udev. [1] https://git.kernel.org/pub/scm/linux/hotplug/udev.git/tree/src/libudev.c _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
