Skip to content

Instantly share code, notes, and snippets.

@palm002
Last active February 20, 2020 10:13
Show Gist options
  • Save palm002/aedbc422e5504b385f4e6b5c54411edd to your computer and use it in GitHub Desktop.
Save palm002/aedbc422e5504b385f4e6b5c54411edd to your computer and use it in GitHub Desktop.
getting PID from a service enabled by user
#!/usr/bin/env bash
# capture the PID of service
ps aux | grep $SERVICE | grep jenkins | grep -v grep | awk '{print $2}' > /path/to/logs/log.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment