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

nginx_clean --user <user> --force doesn't seem to kill the pun? #485

Closed
brandon-biggs opened this issue Apr 29, 2020 · 1 comment · Fixed by #486
Closed

nginx_clean --user <user> --force doesn't seem to kill the pun? #485

brandon-biggs opened this issue Apr 29, 2020 · 1 comment · Fixed by #486

Comments

@brandon-biggs
Copy link

./nginx_stage nginx_list
user1
user2

./nginx_stage nginx_clean --user user1 --force
Nothing returns here

./nginx_stage nginx_clean --user user2 --force
Nothing returns here

./nginx_stage nginx_list
user1
user2

./nginx_stage nginx_clean --force
user1
user2

./nginx_stage nginx_list

I've never written Ruby before, today was the first time, so if this is a dumb fix.. feel free to laugh, but let me know how to do better, but this fixed it. Let me know if you have any questions.

Lines 55-61, 65-69 are new, and modified line 73.

 52     # Accepts `skip_nginx` as an option
 53     add_skip_nginx_support
 54 
 55     # Get the username provided by -u
 56     username = ""
 57     for i in 0 ... ARGV.length
 58       if (ARGV[i] == "-u" || ARGV[i] == "--user") && ARGV[i+1]
 59         username=ARGV[i+1]
 60       end
 61     end
 62 
 63     # Find users with PUNs that have no active sessions and kill the process
 64     add_hook :delete_puns_of_users_with_no_sessions do
 65       # Check to see if username was actually provided
 66       if user && username == ""
 67         puts "No username was given."
 68         exit
 69       end
 70 
 71       NginxStage.active_users.each do |u|
 72         begin
 73           next if (user && username != u.name)
 74           pid_path = PidFile.new NginxStage.pun_pid_path(user: u)
 75           socket = SocketFile.new NginxStage.pun_socket_path(user: u)
@github-actions github-actions bot added this to the Needs Triaged milestone Apr 29, 2020
treydock added a commit that referenced this issue Apr 29, 2020
@treydock
Copy link
Contributor

@brandon-biggs A proposed fix has been added to #486. The original change was flawed in the comparison being made and the way the argument was defined was also wrong.

@ericfranz ericfranz removed this from the Needs Triaged milestone Dec 7, 2020
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 a pull request may close this issue.

3 participants