From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2142 Path: news.gmane.org!not-for-mail From: Peter Hickman Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Getting a process to run as root Date: Fri, 27 Apr 2012 15:42:21 +0100 Message-ID: References: <20120425150746.414ef293@b0llix.net> <20120426204920.77c8315d@b0llix.net> <20120427131329.4ebfc294@b0llix.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1335537749 16409 80.91.229.3 (27 Apr 2012 14:42:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 27 Apr 2012 14:42:29 +0000 (UTC) Cc: supervision@list.skarnet.org To: Wayne Marshall Original-X-From: supervision-return-2376-gcsg-supervision=m.gmane.org@list.skarnet.org Fri Apr 27 16:42:28 2012 Return-path: Envelope-to: gcsg-supervision@plane.gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1SNmNM-0003JN-Pi for gcsg-supervision@plane.gmane.org; Fri, 27 Apr 2012 16:42:24 +0200 Original-Received: (qmail 13845 invoked by uid 76); 27 Apr 2012 14:46:08 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 13837 invoked from network); 27 Apr 2012 14:46:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7ApME3ifJMxuiFzfkCW4f//mZZmCBgRSvpt4+AlQZ8I=; b=YfxTE91897hZOdOEY5HYx5bRlOZ9sm2xs7i+j6bvA0Ne1gOqWzew0a8RmkdAx8MU5I zGDp0I0REJ9KbgeQI3vXGkvGbshtWBiq9zsLsxR+UpAZ/GegaL3bT7qwR05chuZs+p39 X2so99lcu18qSQLh06/AjPP6P4WBgkYwzOY+gk3gf54NNLMjlicfsWIJKfWcnAcj/X+H XRaomrmLBXByedsHdmuB9JZjFWr8o0ik/I7ddMsY/bsVoG92V72UOpZnihto3m7DdXSq +YmfuBBAvRmdaFbOmO9Mfbe8vLPUDhCPhZgzWfxceF6ZigywbhGbYZn15DhrlkeQ6TGz askw== In-Reply-To: Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2142 Archived-At: There we go solved, in my case at least. I kept the /etc/sv/runsvdir-log_watcher/run file as it was but changed the /home/log_watcher/service/log_watcher/run file to this: #!/bin/bash set -e EXEC="sudo -u log_watcher ruby log_watcher.rb known_logs.yml" # Run the script. cd /home/log_watcher/log_watcher/current export RAILS_ENV=production exec $EXEC The significant change was adding the "sudo -u log_watcher" to the EXEC string. To be honest it seems horribly convoluted but it seems to work just fine. Again thanks for the help.