Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addresses #74 by adding ability to assign names to services #77

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

xxxserxxx
Copy link
Contributor

  • Have you test the code?
  • Have you check that the existing tests are passing?
  • The destination branch is develop?

This change allows user to provide a -name <name> argument that will be used instead of the PID in supervisors for services added from the command line by non-root users. For example:

$ immortal -name top top -bn 5
$ immortalctl
    PID           Up   Down   Name      CMD
 ... <snip> ...
1676432   1h37m16.1s          1757      skippy-xd --start-daemon
2021609        13.8s          top       top -bd 5

After this, the usual immortalctl commands of stop, start, and halt using the name work as usual. This makes non-root usage much more convenient, e.g.:

$ immortalctl stop top

This addresses #74 in that it makes running immortalctl commands easier for users, as they do not have to first determine the supervisor PID. This will make scripting easier, as well.

As a design note, I first implemented this through the -ctl argument; however, it would have affected the behavior of the root use; immortal -ctl foo foocommand would have tried to use ~root/.immortal/ instead of /var/run/immortal as was the behavior prior to my change. Since this was a breaking change (whether or not it was much used), I went with adding a new argument.

-ctl and -name are not compatible; -ctl always overrides -name. One enhancement would be throwing an error if both are provided; that is not included in this patch.

I do not know why github is listing both changes in the diff, since the other patch has been accepted and merged. I find github's behavior baffling sometimes.

@nbari nbari merged commit 25a8a7c into immortal:develop Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants