From 8e5658727aa4f2f9f71f44e1534b1ce21cd542f2 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 5 Jul 2010 07:59:06 +0000 Subject: Add system startup/logrotate scripts. Rename conf to conf.example to prevent conf file overwriting. --- server/TODO | 25 ++++++++++---------- server/configure.in | 3 +++ server/etc/Makefile.am | 4 ++-- server/etc/pracrod.conf | 7 ------ server/etc/pracrod.conf.example | 7 ++++++ server/gentoo/init.d/Makefile.am | 7 ++++++ server/gentoo/init.d/pracrod.in | 44 +++++++++++++++++++++++++++++++++++ server/gentoo/logrotate.d/Makefile.am | 7 ++++++ server/gentoo/logrotate.d/pracrod | 15 ++++++++++++ 9 files changed, 97 insertions(+), 22 deletions(-) delete mode 100644 server/etc/pracrod.conf create mode 100644 server/etc/pracrod.conf.example create mode 100644 server/gentoo/init.d/Makefile.am create mode 100755 server/gentoo/init.d/pracrod.in create mode 100644 server/gentoo/logrotate.d/Makefile.am create mode 100644 server/gentoo/logrotate.d/pracrod diff --git a/server/TODO b/server/TODO index 042b000..8603b4d 100644 --- a/server/TODO +++ b/server/TODO @@ -1,16 +1,15 @@ -prefetch field +client: - A 'prefetch' attribute on a field makes the server look up the value on the - pentominos server, using the current patient id, the prefetch field as the - raw request. The latest returned value is the only one used. - A prefetch field overrides the value field. - If a prefetch fails due to no data available, the value field is used. - +sessionid skal lagres lokalt med template navn. +konsekvenser ved templateskift (på samme cpr) skal undersøges. +konsekvenser ved ændring af template på serveren (f.eks ved ombytning + af to makroer) skal undersøges. +overvej generering af sessions id vha. cpr-nummer/template, hvorved cross + client sessioner muliggøres. +overvej problemer med samtidighed (to klienter arbejder på samme session + samtidig) -Things to think about: - - What to do with resumes in included macroes. Append/prepend to main resume? - - How to integrate fetched values (eg. from Pentominos) and how to store where - the values came from (device/usertyped) - - Can connection keep alive be used for anything useful? Session? State? - - What to do about commits on nondata macroes? (eg. start) \ No newline at end of file +# bug: rod med rækkefølgen af tidligere indtastede værdier kontra målinger +# fra artefact +# done \ No newline at end of file diff --git a/server/configure.in b/server/configure.in index 3469af2..c6efd08 100644 --- a/server/configure.in +++ b/server/configure.in @@ -202,6 +202,9 @@ AC_SUBST(PTHREAD_LIBS) AC_OUTPUT( Makefile src/Makefile + src/macrotool/Makefile + gentoo/init.d/Makefile + gentoo/logrotate.d/Makefile etc/Makefile man/Makefile xml/templates/Makefile diff --git a/server/etc/Makefile.am b/server/etc/Makefile.am index eb5b4aa..b814c8e 100644 --- a/server/etc/Makefile.am +++ b/server/etc/Makefile.am @@ -1,7 +1,7 @@ EXTRA_DIST = \ - pracrod.conf + pracrod.conf.example sysconfdir=${prefix}/etc/ dist_sysconf_DATA = \ - pracrod.conf + pracrod.conf.example diff --git a/server/etc/pracrod.conf b/server/etc/pracrod.conf deleted file mode 100644 index 5fb7494..0000000 --- a/server/etc/pracrod.conf +++ /dev/null @@ -1,7 +0,0 @@ -port = 12345; - -journal_commit_addr = "localhost"; -journal_commit_port = 18112; - -artefact_addr = "localhost"; -artefact_port = 11108; diff --git a/server/etc/pracrod.conf.example b/server/etc/pracrod.conf.example new file mode 100644 index 0000000..5fb7494 --- /dev/null +++ b/server/etc/pracrod.conf.example @@ -0,0 +1,7 @@ +port = 12345; + +journal_commit_addr = "localhost"; +journal_commit_port = 18112; + +artefact_addr = "localhost"; +artefact_port = 11108; diff --git a/server/gentoo/init.d/Makefile.am b/server/gentoo/init.d/Makefile.am new file mode 100644 index 0000000..9056326 --- /dev/null +++ b/server/gentoo/init.d/Makefile.am @@ -0,0 +1,7 @@ +EXTRA_DIST = \ + pracrod.in + +initddir=${prefix}/etc/init.d + +dist_initd_SCRIPTS = \ + pracrod diff --git a/server/gentoo/init.d/pracrod.in b/server/gentoo/init.d/pracrod.in new file mode 100755 index 0000000..e226a9b --- /dev/null +++ b/server/gentoo/init.d/pracrod.in @@ -0,0 +1,44 @@ +#!/sbin/runscript +# -*- shell-script -*- +# Copyright 2010 Bent Bisballe Nyeng (deva@aasimon.org) +# Distributed under the terms of the GNU General Public License v2 + +_PROG="pracrod" +_PREFIX="@prefix@" +_CONF="${_PREFIX}/etc/pracrod.conf" +_BIN="${_PREFIX}/bin/pracrod" +_XML="${_PREFIX}/xml" +_LOG="/var/log/pracrod.log" + +depend() { + need net + need postgresql +# provide pracrod +} + +checkconfig() { + if [ ! -f ${_CONF} ] ; then + eerror "Please create ${_CONF}. Take a look at ${_CONF}.example" + return 1 + fi + return 0 +} + +start() { + checkconfig || return $? + + ebegin "Starting ${_PROG}" + start-stop-daemon --start --exec ${_BIN} \ + --pidfile /var/run/${_PROG}.pid \ + -- --pidfile /var/run/${_PROG}.pid --config ${_CONF} \ + --xml-basedir ${_XML} -D +fixme,+err,+warn,+info --logfile ${_LOG} + eend $? "Failed to start ${_PROG}" +} + +stop() { + ebegin "Stopping ${_PROG}" + start-stop-daemon --stop -s INT \ + --pidfile /var/run/${_PROG}.pid \ + --exec ${_BIN} + eend $? "Failed to stop ${_PROG}" +} diff --git a/server/gentoo/logrotate.d/Makefile.am b/server/gentoo/logrotate.d/Makefile.am new file mode 100644 index 0000000..64fcb53 --- /dev/null +++ b/server/gentoo/logrotate.d/Makefile.am @@ -0,0 +1,7 @@ +EXTRA_DIST = \ + pracrod + +logrotatedir=${prefix}/etc/logrotate.d + +dist_logrotate_SCRIPTS = \ + pracrod diff --git a/server/gentoo/logrotate.d/pracrod b/server/gentoo/logrotate.d/pracrod new file mode 100644 index 0000000..eab5a82 --- /dev/null +++ b/server/gentoo/logrotate.d/pracrod @@ -0,0 +1,15 @@ +# -*- shell-script -*- +# Copyright 2010 Bent Bisballe Nyeng +# Distributed under the terms of the GNU General Public License v2 + +/var/log/pracrod.log { + weekly + #create 660 root root + notifempty + size 5M + sharedscripts + missingok + postrotate + /bin/kill -s SIGHUP `cat /var/run/pracrod.pid` + endscript +} -- cgit v1.2.3