Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
97d433e
fixes a few docs issues. missing word program in a few places, change…
Jun 3, 2012
8c75e5b
trigger-pull manpage, referencing other manpages appropriately, with …
Jun 3, 2012
1f1072a
trigger-listen manpage, referencing other manpages appropriately, wit…
Jun 3, 2012
3c5a5fe
adds link to trigger-listen HTML page, because we can
Jun 3, 2012
3d8b9da
trigger-wait manpage, referencing other manpages appropriately, with …
Jun 3, 2012
9e41980
dash '.' is broken, prefix build_it_cmds with './' to make build work…
Jun 2, 2012
4057775
8 spaces does not a tab make (whitespace cleanup)
Jun 2, 2012
6b8e0f3
dash '.' is broken, prefix build_it_cmds with './' to make build work…
Jun 3, 2012
32ddebc
initial debianization; doesn't install binaries to prefix yet
acg Jun 4, 2012
7fd8848
top level makefile for common tasksh
acg Jun 4, 2012
1068efa
debian package: override 'make install' for a non-/package install
acg May 8, 2013
eee42e4
debian package: the build depends on asciidoc
acg Sep 18, 2013
be0ede7
`make dist` now creates a source tarball.
acg Apr 24, 2015
ac229e6
docs: build *.1 man pages with a2x.
acg Apr 25, 2015
578dff6
build documentation via `make all`.
acg Apr 25, 2015
f70df07
install manpages in ubuntu package.
acg Apr 25, 2015
468369b
asciidoc manpager dislikes !!!!, barfs tags in output.
acg Apr 25, 2015
a88fc73
asciidoc: disable network dtd fetching.
acg Apr 26, 2015
d364d98
ubuntu packaging updates. bump to 0.67.
acg Apr 24, 2015
c40f1e4
bump to 0.68
acg Apr 26, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
all :
$(MAKE) -C src it
$(MAKE) -C doc it

clean :
$(MAKE) -C src clean
$(MAKE) -C doc clean

install :
package/install

dist :
sh src/tarsource.sh

18 changes: 18 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
trigger (0:0.68) trusty; urgency=low

* release 0.68 from alangrow.com. man page fixes.

-- Alan Grow <agrow@iobound.net> Sun, 26 Apr 2015 16:24:41 -0600

trigger (0:0.67) trusty; urgency=low

* release 0.67 from alangrow.com

-- Alan Grow <agrow@iobound.net> Sat, 18 Apr 2015 17:57:30 -0600

trigger (0:0.66) unstable; urgency=low

* release 0.66 from superscript.com

-- Super Script <sst@superscript.com> Mon, 04 Jun 2012 11:20:19 -0400

1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7
13 changes: 13 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Source: trigger
Section: devel
Priority: optional
Maintainer: Super Script <sst@superscript.com>
Build-Depends: debhelper (>= 7.0.50~), asciidoc (>= 8.6.9~),
xsltproc (>= 1.1.28~), docbook (>= 4.5~), docbook-xml (>= 4.5~), docbook-xsl (>= 1.78~)
Standards-Version: 0.1.0

Package: trigger
Architecture: any
Depends: ${shlibs:Depends}
Description: Unix utilities for event-based program execution.
Unix utilities for event-based program execution.
9 changes: 9 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This package was debianized by Alan Grow <alangrow+trigger@gmail.com> on
Mon, 04 Jun 2012 11:20:19 -0400

Upstream Author: Super Script (sst@superscript.com)

Copyright:

This code, like Prof.~ Bernstein's original code, is released into the public
domain.
14 changes: 14 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/make -f
# -*- makefile -*-

DIR = ./debian/trigger

%:
dh $@

override_dh_install:
install -d -m 0755 $(DIR)/usr/bin
install -m 0755 command/* $(DIR)/usr/bin
install -d -m 0755 $(DIR)/usr/share/man/man1
install -m 0644 doc/*.1 $(DIR)/usr/share/man/man1

17 changes: 16 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ install.html \
trigger-listen.html \
trigger-pull.html \
trigger-wait.html \
trigger-listen.1 \
trigger-pull.1 \
trigger-wait.1 \
develop.html \
asciidoc.css
sh makefile.build default.build it it
Expand Down Expand Up @@ -74,6 +77,15 @@ webpage.conf \
attribute.conf
sh makefile.build default.html.build trigger-wait.html trigger-wait

trigger-listen.1: trigger-listen.txt
sh makefile.build default.1.build trigger-listen.1 trigger-listen

trigger-pull.1: trigger-pull.txt
sh makefile.build default.1.build trigger-pull.1 trigger-pull

trigger-wait.1: trigger-wait.txt
sh makefile.build default.1.build trigger-wait.1 trigger-wait

clean:
rm -f \
attribute.conf \
Expand All @@ -84,4 +96,7 @@ clean:
mkfile \
trigger-listen.html \
trigger-pull.html \
trigger-wait.html
trigger-wait.html \
trigger-listen.1 \
trigger-pull.1 \
trigger-wait.1
5 changes: 5 additions & 0 deletions doc/default.1.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build_ifchanged "$2.txt"
safe a2x --format manpage --no-xmllint --xsltproc-opts "--nonet" "$2.txt"
safe cat "$1" # a2x can't write to stdout? :/
exit $?

3 changes: 3 additions & 0 deletions doc/it=d
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ trigger-pull.html
trigger-wait.html
develop.html
asciidoc.css
trigger-listen.1
trigger-pull.1
trigger-wait.1
2 changes: 1 addition & 1 deletion doc/makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ build_dependcc() {
}

build_do() {
( . "$build_it_cmds" "$1" "$2" "$3" > "$3" )
( . "./$build_it_cmds" "$1" "$2" "$3" > "$3" )
}

build_it() {
Expand Down
64 changes: 34 additions & 30 deletions doc/trigger-listen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@
:doctype: manpage

== NAME
trigger-listen - listen to a fifo and run a command
trigger-listen - listen to a fifo(7) and execute a command


== SYNOPSIS
!!!!
trigger-listen [ -UdDqQv1 -c _limit_ -t _timeout_ -i _interval_ -g _gid_ -u _uid_ ] _path_ _prog_
!!!!
*+trigger-listen+ [ +-UdDqQv1+ +-c+ +_limit_+ +-t+ +_timeout_+ +-i+ +_interval_+ +-g+ +_gid_+ +-u+ +_uid_+ ] +_path_+ +_prog_+*


== DESCRIPTION
The +trigger-listen+ program listens for input on the fifo +_path_+. When
it receives input +trigger-listen+ invokes +_prog_+ and continues to
listen for input on +_path_+. An external program pulls the trigger by
writing a byte of data to +_path_+. The +trigger-listen+ does not examine input
data.
The +trigger-listen+ program listens for input on the +fifo(7)+ +_path_+ using
+read(2)+. When it receives input +trigger-listen+ invokes +_prog_+ and
continues to listen for input on +_path_+. An external program pulls the
trigger by writing a byte of data to +_path_+. The +trigger-listen+ program
does not examine input data.


== OPTIONS

=== GENERAL OPTIONS
+-q+::
Quiet. Do not print error messages.

+-Q+::
+-Q+::
Print error messages. (Default)

+-v+::
Verbose. Print both status and error messages.


=== LISTENING OPTIONS
+-1+::
Execute +_prog_+ immediately upon startup.
Expand All @@ -40,45 +40,49 @@ trigger pull occurs while +_limit_+ copies are running,
copies exits.

+-t _timeout_+::
Wait at most +_timeout_+ seconds for a trigger pull. If
+_timeout_+
Wait at most +_timeout_+ seconds for a trigger pull. If +_timeout_+
seconds elapse without a trigger pull, then +trigger-listen+ pulls
its own trigger. The default value of +_timeout_+
is +(unsigned int)~0+.
its own trigger. (Default: +(unsigned int)~0+)

+-i _interval_+::
Wait at least +_interval_+ seconds between executions of
+_prog_+. If
it receives a trigger pull within +_interval_+ seconds of the last
execution, +trigger-listen+ executes +_prog_+ when
+_interval_+
seconds have elapsed. The default value of +_interval_+ is 0.
+_prog_+. If +trigger-listen+ receives a trigger pull within +_interval_+
seconds of the last execution, +trigger-listen+ executes +_prog_+ when
+_interval_+ seconds have elapsed. (Default: 0).

+-g _gid_+::
Switch group ID to +_gid_+ after preparing to receive trigger pulls.
Set the effective group ID to +_gid_+ using +setgid(2)+ after preparing to
receive trigger pulls.

+-u _uid_+::
Switch user ID to +_uid_+ after preparing to receive connections.
Set the effective user ID to +_uid_+ using +setuid(2)+ after preparing to
receive trigger pulls.

+-U+::
Same as +-g $GID -u $UID+. Typically, +$GID+ and +$UID+ are
set by http://cr.yp.to/daemontools/envuidgid.html[+envuidgid+].
Set the effective user ID to the +environ(7)+ variable +_UID_+ and the
effective group ID to the +environ(7)+ variable +_GID_+ after preparing to
receive trigger pulls. Same as +-g+ +_$GID_+ +-u+ +_$UID_+, where +_$UID_+
and +_$GID_+ are typically set by
http://cr.yp.to/daemontools/envuidgid.html[+envuidgid(8)+].

+-d+::
Delete. Remove and recreate the fifo +_path_+ upon startup. (Default)
+-d+::
Delete. Remove and recreate the +fifo(7)+ +_path_+ upon startup. (Default)

+-D+::
No delete. Do not remove and recreate +_path_+ upon startup.


== EXIT STATUS
The +trigger-listen+ program exits 111 for temporary errors and 100 for
permanent errors. It exits 0 on success or when terminated by signal.
permanent errors. +trigger-listen+ exits 0 on success or when terminated by
signal.


== EXAMPLES
!!!!
trigger-listen ./trigger echo \'Hello world!'
!!!!
*+trigger-listen+ ./trigger echo \'Hello world!'*


== SEE ALSO
+mkfifo(1)+, link:trigger-pull.html[+trigger-pull(1)+],
link:trigger-wait.html[+trigger-wait(1)+], +setuid(2)+, +setgid(2)+,
+fifo(7)+, +envuidgid(8)+
22 changes: 9 additions & 13 deletions doc/trigger-pull.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,23 @@
:doctype: manpage

== NAME
trigger-pull - write a non-blocking byte to a fifo to pull a trigger
trigger-pull - write a non-blocking byte to a fifo(7) to pull a trigger

== SYNOPSIS
!!!!
trigger-pull _path_
!!!!
*+trigger-pull+ +_path_+*

== DESCRIPTION
The +trigger-pull+ performs a non-blocking write of one byte of data to
+_path_+.
The +trigger-pull+ program performs a non-blocking +write(2)+ of one byte of
data to +_path_+.

== EXIT STATUS
The +trigger-pull+ program exits 100 for incorrect usage and 111 for temporary
errors. It does not retry if the write would have blocked and it ignores the
lack of reader on the fifo +_path_+, treating these as successes.

errors. It does not retry if the +write(2)+ would have blocked and it ignores the
lack of reader on the +fifo(7)+ +_path_+, treating these as successes.

== EXAMPLES
!!!!
trigger-pull ./trigger
!!!!

*trigger-pull ./trigger*

== SEE ALSO
+mkfifo(1)+, link:trigger-listen.html[+trigger-listen(1)+], +trigger-wait(1)+, +fifo(7)+

42 changes: 21 additions & 21 deletions doc/trigger-wait.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,50 @@
:doctype: manpage

== NAME
trigger-wait - listen to a trigger and optionally run a command
trigger-wait - listen to a fifo(7) and optionally execute a command

== SYNOPSIS
!!!!
trigger-wait [ -wWdD -t _timeout_ ] _path_ [ _prog_ ]
!!!!
*+trigger-wait+ [ +-wWdD+ +-t+ _timeout_ ] _path_ [ _prog_ ]*


== DESCRIPTION
The +trigger-wait+ listens for input on the fifo +_path_+. If +_prog_+ is
present, +trigger-wait+ runs it and optionally waits for it to complete. It
then exits 0 if it received a trigger pull and 99 otherwise.
The +trigger-wait+ program listens for input on the +fifo(7)+ +_path_+ using
+read(2)+. If +_prog_+ is present, +trigger-wait+ executes +_prog_+ and
optionally waits for it to complete.


=== OPTIONS
+-t _timeout_+::
Wait at most +_timeout_+ seconds for a trigger pull. If +_timeout_+
seconds elapse without a trigger pull, then +trigger-listen+ pulls
its own trigger. The default value of +_timeout_+
is +(unsigned int)~0+.
seconds elapse without a trigger pull, then +trigger-wait+ pulls
its own trigger. (Default: +(unsigned int)~0+)

+-w+::
Wait for +_prog_+ to complete. (Default)
Wait for +_prog_+ to complete before exit. (Default)

+-W+::
Do not wait for +_prog_+ to complete.
Do not wait for +_prog_+ to complete before exit.

+-d+::
Delete. Remove and recreate the fifo +_path_+ upon startup. (Default)
Delete. Remove and recreate the +fifo(7)+ +_path_+ upon startup. (Default)

+-D+::
No delete. Do not remove and recreate +_path_+ upon startup.


== EXIT STATUS
The +trigger-wait+ program exits 100 for permanent
errors and 111 for temporary errors. It exits 0 if it received a trigger pull,
and 99 otherwise.
The +trigger-wait+ program exits 100 for permanent errors and 111 for
temporary errors. It exits 0 if it received a trigger pull, and 99 otherwise.


== EXAMPLES
Assume that the processor for +/service/foo/log+ pulls the trigger as its dying
act:
!!!!
cd /service/foo && trigger-wait -t 5 ./trigger-rotate svc -a log
!!!!
Assume that the processor for +_/service/foo/log_+ pulls the trigger as its
dying act:

*cd /service/foo && trigger-wait -t 5 ./trigger-rotate svc -a log*


== SEE ALSO
+mkfifo(1)+, link:trigger-pull.html[+trigger-pull(1)+],
link:trigger-listen.html[+trigger-listen(1)+], +fifo(7)+, +multilog(8)+,
+svc(8)+
3 changes: 1 addition & 2 deletions package/build
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ then
safe awk '
BEGIN {
for (i = 1;i < ARGC;++i)
file[ARGV[i]] = 1
file[ARGV[i]] = 1
ARGC = 1
}
{ if (file[$1]) print $1 }
Expand All @@ -138,4 +138,3 @@ else
fi

exit 0

2 changes: 2 additions & 0 deletions package/versions
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
0.60
0.65
0.66
0.67
0.68
Loading