From 4ed7bc7f9095934cfc8ec1881bc24649d00e77d8 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Sat, 21 Dec 2013 12:09:18 +0400 Subject: [PATCH] Release 1.0.0 --- PKGBUILD | 26 ++++++++++++++++++++++++++ README.md | 44 +++++++++++++++++++++++++++++++++++++++++++- queued-1.0.0.tar.xz | Bin 0 -> 2216 bytes sources/queued | 7 ++++--- 4 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 PKGBUILD create mode 100644 queued-1.0.0.tar.xz diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..33b997b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,26 @@ +# Author: Evgeniy "arcanis" Alexeev +# Maintainer: Evgeniy "arcanis" Alexeev + +pkgname=queued +pkgver=1.0.0 +pkgrel=1 +pkgdesc="Daemon for starting jobs to queue of calculations" +arch=('any') +url="https://github.com/arcan1s/queued" +license=("GPL") +makedeps=('git') +source=(https://github.com/arcan1s/queued/releases/download/V.${pkgver}/${pkgname}-${pkgver}.tar.xz) +md5sums=('d93c8cf20804b07b47645b0c43d45d3d') +backup=('etc/queued.conf') + +package() +{ + # daemon + install -D -m755 "${srcdir}/${pkgname}/usr/bin/queued" "${pkgdir}/usr/bin/queued" + + # service + install -D -m644 "${srcdir}/${pkgname}/usr/lib/systemd/system/queued.service" \ + "${pkgdir}/usr/lib/systemd/system/queued.service" + install -D -m644 "${srcdir}/${pkgname}/etc/queued.conf" \ + "${pkgdir}/etc/queued.conf" +} diff --git a/README.md b/README.md index 0a0001d..667aff5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,46 @@ queued ====== -Daemon for starting jobs to queue of calculations +Information +----------- +Daemon for starting jobs to queue of calculations. To start deamon just run `systemctl start queued` as root. + +help message +------------ + queued [ -jd | --jobdir /var/lib/queued/job ] [ --priority 0 ] [ -q | --queuefile /var/lib/queued/queue ] [ -u | --user root ] [ -wd | --workdir /var/lib/queued/work ] [-v | --version ] [ -h | --help ] + + Parametrs: + -jd --jobdir PATH - path to job directory. Default is '/var/lib/queued/job' + --priority NUM - defalut priority. Default is '0' + -q --queuefile PATH - path to queue file. Default is '/var/lib/queued/queue' + -u --user USERNAME - start jobs by user. Default is 'root' + -wd --workdir PATH - path to work directory. Default is '/var/lib/queued/work' + -v --version - show version and exit + -h --help - show this help and exit + +Configuration +------------- +All settings are stored in `/etc/queued.conf`. After edit them you must restart daemon (`systemctl restart queued`). + +How-to run jobs +--------------- +* create shell script with the command (it have a name `script.sh` for example) +* create priority file (`script.sh.pr`) with the job priority if it is needed +* create user file (`script.sh.user`) with the job username if it is needed +* copy files to `$WORKDIR` + + +Instruction +=========== + +Dependencies +------------ +* bash (sed, awk, etc) +* systemd + +Installation +------------ +* download sources +* copy source to `/`: + + sudo cp ../queued/* / diff --git a/queued-1.0.0.tar.xz b/queued-1.0.0.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..3256961e1aad02be57243a386cde5b53e26b4cea GIT binary patch literal 2216 zcmV;Z2v_(0H+ooF000E$*0e?f03iVu0001VFXf})Gye!>T>vm&rwJ>hrzoU!3PVY{00wTIJy}d=Lq+b@C8jCiX$IL(^vIQ zCW`~F%1K}`0HqBzU}j#AZqi)>VB{{$@pHR>sdD~O@oqZxb^zCYHQhu>@=hM;(r*Jq z`P){7v^^Wy3BA~pts?o$QD_TdLj4L^+n*(1lJiy;dveK!#lKDjhxsW(2B>gUNAB4Q zsRPWdTXl>s_(!6*6XA?K6aV&eMX3V8gv%29;6?`yMI$G6Wc7rxLksH+BOR*-JB3(ouK)d>r5ZXkESJu~r(5va zyW^`aJT~RGuMN?&pTCbRS=o}?vTQc5lzpJZdjt*7cf#k(Fi-WZPB#K26P-b`rzQEz zwhJ1GO7Lul4qcJ$giLq*=k4Wf6rR=oX zP>vcn1*VpGrg{?f$BW=6eY0S1@>&Rs#!XDS2HTUIW}R&&PSYen@IT7DRXj-gZgb~_ zMx9q@W2y&C8ZfrfmHcv&qLvd05VuTV_zr%V=-a$LHZX0O4mKUQ@$n>_od~W`YRsZF zelU)FBSX;rIlpc{Nv`4Lq{er}8zQK~le<`#%ChQ5!;lj=Kg2hWtKkDA)Hki*C;XMb zJ0!|WgEVzx@^!Qik-@}`E0I7Ud6w|KG2)j;EGbnC3!5YDr4usq7Tupa+1nF(O@(H0@FEZ+QW}ZS=2(+}C-2h25`Vg=D8)8FgNhJ%+S+!65uJNe} zyZ_$?2^9$9F&g7ex!T?o?)n@}sA6{Jp~6{q%jowv|riXq(7=W}S_ zuk4DqsIb@J%zRjLP9%N@2_k3nUaNSKY>NqsIq6tF*P@0kkP z=PIwq)rTUs{Nm)hz{O(sgC-dgSIYoBkN5V$iRJ5qTbetDnElkEJAh)4jF! zs6Ho9Xpq0o2Nkp(sZ(+>Fi&K+YVA_78O#K zPPm4i;zmfyGi-TR^FidoH2pB!!he4s5mTkiP6nRTVz)3R>OK;tRA( zej)$G0S)e0VvBBE=glA5wbV&xH<_I;Xv=0&V*e#Xt}n~V8^tQ@`f3QJVJ<8cw(JvP z02Wj{w7DV>kM6^EsJ7;%~B zPm9K7xRMGFSt;%(QC^`32AReN(G}%UItF;pX{0{iwCruom7duidi_CDQnsKFcT5;k zEmp@}Cv4N /dev/null || break + [ -e "$CURJOB".user ] && CUR_USER="$(cat "$CURJOB".user)" || CUR_USER="$STARTASUSER" + mv "$CURJOB"* "$JOBDIR/" 2> /dev/null || break echo "[II] Running job '$CURJOB'" - su -c "/bin/sh "$JOBDIR/$(basename "$CURJOB")"" $STARTASUSER &> "$JOBDIR/$(basename "$CURJOB")".log & + su -c "/bin/sh "$JOBDIR/$(basename "$CURJOB")" &> "$JOBDIR/$(basename "$CURJOB")".log" $CUR_USER & ) else echo "[II] You have a running job"