Skip to content

Commit

Permalink
Merge pull request #1 from secynic/dev
Browse files Browse the repository at this point in the history
0.1.1
  • Loading branch information
secynic committed Apr 1, 2016
2 parents f22c5ef + 09fbf3a commit 4ca27b8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

0.1.1 (2016-03-31)
------------------

- Bash declaration changed to #!/usr/bin/env bash
- File extension added (.sh)
- Fixed typos in README code examples

0.1.0 (2015-01-30)
------------------

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015 Philip Hane
Copyright (c) 2015, 2016 Philip Hane
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Usage

Command::

proc_wrapper [-c '<string>'] [-n <string>] [-a] [-t <int>] [-ld <dir>]
proc_wrapper.sh [-c '<string>'] [-n <string>] [-a] [-t <int>] [-ld <dir>]
[-td <dir>] [-d] [-v]

Options::
Expand Down Expand Up @@ -67,20 +67,20 @@ Make sure to follow hardening standards for locations, permissions, etc.**
Python script with 180s timeout, active enabled, and directories::

cd /home/uname/proc_wrapper
./proc_wrappper -c '/usr/local/bin/python /home/uname/myproj/script.py' -n
./proc_wrapper.sh -c '/usr/local/bin/python /home/uname/myproj/script.py' -n
'myproj' -a -t 180 -ld /home/uname/myproj/log -td /home/uname/myproj/tmp

The above in cron, run every minute (**-a is not used here**)::

crontab -e
* * * * * /home/uname/proc_wrapper/proc_wrapper -c '/usr/bin/python -u
* * * * * /home/uname/proc_wrapper/proc_wrapper.sh -c '/usr/bin/python -u
/home/uname/myproj/script.py' -t 180 -ld /var/log/myproj -td /tmp/myproj >>
/var/log/myproj-cron.log 2>&1

Show the proc_wrapper version::

cd /home/uname/proc_wrapper
./proc_wrappper -v
./proc_wrapper.sh -v

Installing
==========
Expand Down
8 changes: 5 additions & 3 deletions proc_wrapper → proc_wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (c) 2015 Philip Hane
# Copyright (c) 2015, 2016 Philip Hane
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand All @@ -26,7 +26,7 @@

set -eo pipefail

VERSION='0.1.0'
VERSION='0.1.1'

# Embedded awk program to convert ps output of etime to seconds.
PID_ETIME_AWK=$(cat << 'EOF'
Expand Down Expand Up @@ -186,6 +186,8 @@ kill_proc() {
kill ${pid}
status=$?
reset_pid
log "[${name}] Kill result code: ${status}."
sleep 1
fi
fi
return ${status}
Expand Down

0 comments on commit 4ca27b8

Please sign in to comment.