From: "Денис Ягофаров" <denyago@rambler.ru> To: ALT Linux sysadmin discuss <sysadmins@lists.altlinux.org> Subject: [Sysadmins] Redmine init script Date: Fri, 13 Feb 2009 12:21:18 +0200 Message-ID: <4995499E.7060409@rambler.ru> (raw) [-- Attachment #1: Type: text/plain, Size: 227 bytes --] Доброго времени суток. Я не профессионал в написании init сценариев, но мне понадобилось запускать redmine. Вот что получилось. [-- Attachment #2: redmine.init --] [-- Type: text/plain, Size: 2398 bytes --] #! /bin/sh # # redmine Redmine task tracking system # # chkconfig: - 70 30 # description: \ # Redmine is a flexible project management web application. # Written using Ruby on Rails framework, it is cross-platform and cross-database. # processname: ruby # config: /etc/sysconfig/redmine # Do not load RH compatibility interface. WITHOUT_RC_COMPAT=1 # Source function library. . /etc/init.d/functions SourceIfNotEmpty /etc/sysconfig/redmine RDMSERVE=server RDM_OPTS="-d -e $RDM_ENV" PIDFILE=/tmp/redmine.pid LOCKFILE=none RETVAL=0 PS_COLUMNS="200" RDMSERVE="$RPM_SRV/$RDMSERVE" [ -x "$RDMSERVE" ] || exit 1 start() { start_daemon --displayname redmine --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --user "$RDM_USER" --expect-user "$RDM_USER" -- $RDMSERVE $RDM_OPTS ps aux --columns 200 | grep 'script/server' | grep -v grep | awk '{print $2}' > $PIDFILE RETVAL=$? return $RETVAL } stop() { stop_daemon --displayname redmine --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user "$RDM_USER" -- ruby RETVAL=$? return $RETVAL } restart() { stop start } reload() { msg_reloading redmine stop_daemon --pidfile "$PIDFILE" --expect-user "$RDM_USER" -HUP -- ruby RETVAL=$? return $RETVAL } # See how we were called. case "$1" in start) start ;; stop) stop ;; reload) reload ;; restart) restart ;; condstop) if [ -e "$LOCKFILE" ]; then stop fi ;; condrestart) if [ -e "$LOCKFILE" ]; then restart fi ;; condreload) if [ -e "$LOCKFILE" ]; then reload fi ;; status) status --displayname redmine --pidfile "$PIDFILE" --expect-user "$RDM_USER" -- ruby RETVAL=$? ;; *) msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}" RETVAL=1 esac exit $RETVAL [-- Attachment #3: redmine.sysconfig --] [-- Type: text/plain, Size: 169 bytes --] # Redmine user RDM_USER=redmine # Redmine environment ( -e option ) RDM_ENV=production # Redmine path to server script RPM_SRV=/opt/redmine/redmine-0.8.0/script [-- Attachment #4: denyago.vcf --] [-- Type: text/x-vcard, Size: 281 bytes --] begin:vcard fn:Denis Timurovich Yagofarov n:Yagofarov;Denis Timurovich org:ITGIS NASU adr:room 615;;Chokolovski blvdr., 13;Kiev;;03151;Ukraine email;internet:denyago@rambler.ru title:system administrator tel;work:80442480755 x-mozilla-html:FALSE version:2.1 end:vcard
next reply other threads:[~2009-02-13 10:21 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-02-13 10:21 Денис Ягофаров [this message] 2009-02-13 10:45 ` Alexey I. Froloff
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=4995499E.7060409@rambler.ru \ --to=denyago@rambler.ru \ --cc=sysadmins@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux sysadmins discussion This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \ sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com public-inbox-index sysadmins Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.sysadmins AGPL code for this site: git clone https://public-inbox.org/public-inbox.git