From d7965e0eaa3b6be8c5574bc8d66dd50bc5b301f6 Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Sat, 17 Nov 2012 14:49:40 -0800 Subject: [PATCH] Ubuntu etc files - Point RedHat README to website - Add ubuntu upstart, logrotate configs --- etc/redhat-el6/README | 36 ++--------------------------- etc/ubuntu-12/README | 3 +++ etc/ubuntu-12/inbucket-upstart.conf | 29 +++++++++++++++++++++++ etc/ubuntu-12/inbucket.logrotate | 8 +++++++ 4 files changed, 42 insertions(+), 34 deletions(-) create mode 100644 etc/ubuntu-12/README create mode 100644 etc/ubuntu-12/inbucket-upstart.conf create mode 100644 etc/ubuntu-12/inbucket.logrotate diff --git a/etc/redhat-el6/README b/etc/redhat-el6/README index 40a0c12..bf03921 100644 --- a/etc/redhat-el6/README +++ b/etc/redhat-el6/README @@ -1,35 +1,3 @@ -To setup on RedHat 6 or one of its clones: +Please see the RedHat installation guide on our website: -# Create a service account for the daemon to run as -useradd -r -m inbucket - -# Create datastore directory -mkdir /var/opt/inbucket -chown inbucket: /var/opt/inbucket - -# Copy logrotate config into place -cp inbucket.logrotate /etc/logrotate.d/logrotate -chown root: /etc/logrotate.d/logrotate - -# Copy init script into place and activate -cp inbucket-init.sh /etc/init.d -chown root: /etc/init.d/inbucket -chmod 755 /etc/init.d/inbucket -chkconfig --add inbucket - -# Copy the sample config into place -# NOTE: there is a "cap" command in the init script that allows inbucket -# to listen on privileged ports without running as root. -cp ../unix-sample.conf /etc/opt/inbucket.conf -chown root: /etc/opt/inbucket.conf - -(confirm /etc/opt/inbucket.conf is to your liking) - -# Start the daemon -service inbucket start - -# Confirm it stayed running -service inbucket status - -# Check inbucket's startup messages -less /var/log/inbucket.log +http://jhillyerd.github.com/inbucket/installation/redhat.html diff --git a/etc/ubuntu-12/README b/etc/ubuntu-12/README new file mode 100644 index 0000000..5b254d2 --- /dev/null +++ b/etc/ubuntu-12/README @@ -0,0 +1,3 @@ +Please see the Ubuntu installation guide on our website: + +http://jhillyerd.github.com/inbucket/installation/ubuntu.html diff --git a/etc/ubuntu-12/inbucket-upstart.conf b/etc/ubuntu-12/inbucket-upstart.conf new file mode 100644 index 0000000..810b6a9 --- /dev/null +++ b/etc/ubuntu-12/inbucket-upstart.conf @@ -0,0 +1,29 @@ +# inbucket - disposable email service +# +# Inbucket is an SMTP server with a web interface for testing application +# functionality + +description "inbucket - disposable email service" +author "http://jhillyerd.github.com/inbucket" + +start on (local-filesystems and net-device-up IFACE!=lo) +stop on runlevel [!2345] + +env program=/opt/inbucket/inbucket +env config=/etc/opt/inbucket.conf +env logfile=/var/log/inbucket.log +env runas=inbucket + +# Give SMTP connections time to drain +kill timeout 20 + +pre-start script + [ -x $program ] + [ -r $config ] + touch $logfile + chown $runas: $logfile + # Allow bind to ports under 1024 + setcap 'cap_net_bind_service=+ep' $program +end script + +exec start-stop-daemon --start --chuid $runas --exec $program -- -logfile $logfile $config diff --git a/etc/ubuntu-12/inbucket.logrotate b/etc/ubuntu-12/inbucket.logrotate new file mode 100644 index 0000000..9e02eef --- /dev/null +++ b/etc/ubuntu-12/inbucket.logrotate @@ -0,0 +1,8 @@ +/var/log/inbucket.log { + missingok + notifempty + create 0644 inbucket inbucket + postrotate + [ -x /sbin/reload ] && /sbin/reload inbucket >/dev/null 2>&1 || true + endscript +}