ralphlange / procServ

Wrapper to start arbitrary interactive commands in the background, with telnet or Unix domain socket access to stdin/stdout
GNU General Public License v3.0
23 stars 23 forks source link

Support for systemd environment variables #32

Closed darcato closed 4 years ago

darcato commented 4 years ago

I found a way to solve #31 . I added two optional arguments to the manage-procs add command to set the systemd service file Environment and EnvironmentFile tags. Using these options one can execute an EPICS startup command with environment variables as parameters.

Usage example:

manage-procs add -E my_env_file example_service st.cmd

where my_env_file looks like:

FOO=foo
BAR=bar

or:

manage-procs add -e "FOO=foo" -e "BAR=bar" example_service st.cmd

Let me know if this can be merged.

ralphlange commented 4 years ago

@mdavidsaver - what's your take on this?

darcato commented 4 years ago

I also implemented bash autocompletion with argcomplete and added two more commands: restart to restart an instance and logs to show the logs. Let me know if you are interested and if you want me to add those to this pull request or if I should open another one after this is merged.

ralphlange commented 4 years ago

@mdavidsaver - any comments?