From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id AA05D1381F3 for ; Fri, 16 Aug 2013 04:45:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 087C7E0B59; Fri, 16 Aug 2013 04:45:01 +0000 (UTC) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A809AE0B05 for ; Fri, 16 Aug 2013 04:44:59 +0000 (UTC) Received: by mail-pb0-f46.google.com with SMTP id rq2so1554423pbb.5 for ; Thu, 15 Aug 2013 21:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:in-reply-to:references:content-type :mime-version:content-transfer-encoding; bh=1T4rK0R6mUdwdZUtSJ9Pl+kIK0YE/16Boxm4Bd9u8U8=; b=LzGAGArKm3lMrqjYdLzs1+aJgMVAaPpqMDuLcHsy/cCS3NGnvcUh4I+O9VVT1FNc5U DJYoERgsD7EyGILtUZ2AFfZiFIVMYWsHJagd8ajVbPxByeoJSZzBxCbdkvJ5gJocF3GE /lZtPVljk9/8Dm/4PQRtMyQ3Vw99FMExLpXGh93xwIosXh/tXi8lk9SBQBJUin2NhUu5 CZsVjlaFbG9/z62YZQO+60i6tyMldak0DJhXWJJTkNm0cWwDwLanQXtZQt/CBCtcjbk6 55MSDs1WQZFdT9D/ZTgjFLiwYHoTqweOhHECsmvKd6hp88XFjog90rRWfhlgHkx7jxQt B4lw== X-Received: by 10.66.254.194 with SMTP id ak2mr361863pad.167.1376628298556; Thu, 15 Aug 2013 21:44:58 -0700 (PDT) Received: from [192.168.1.165] (c-24-6-133-82.hsd1.ca.comcast.net. [24.6.133.82]) by mx.google.com with ESMTPSA id z14sm3752437pbt.0.2013.08.15.21.44.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 21:44:57 -0700 (PDT) Message-ID: <1376628293.1883.14.camel@siegeengine> Subject: Re: [gentoo-user] systemd and local equivalent From: Mark Pariente To: gentoo-user@lists.gentoo.org Date: Thu, 15 Aug 2013 21:44:53 -0700 In-Reply-To: <21736.1376602908@ccs.covici.com> References: <21736.1376602908@ccs.covici.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.8.4 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Archives-Salt: 4d414fd3-8b9b-46a6-b82d-e994cbeee1e9 X-Archives-Hash: 65b299a3fa0875bc4a3fbfd4c2019e4e On Thu, 2013-08-15 at 17:41 -0400, covici@ccs.covici.com wrote: > Hi. I would like to be able to have an equivalent of /etc/local.d/ > something to execute those commands which do not fit neatly into the > boot scheme -- for instance I have several things which have something > in init.d and I just have to say /etc/init.d/ start after > everything is up. There are other miscellaneous commands I need to > issue, so how can I do this using systemd? > > Thanks in advance for any suggestions. > You could write a simple unit file /etc/systemd/system/my-stuff.service: [Unit] Description=My Stuff [Service] Type=oneshot ExecStart=/../my-script --start ExecStop=/../my-script --stop [Install] WantedBy=multi-user.target And then enable this service with: systemctl enable my-stuff.service Please note you might need to add some dependencies (for example if you need networking etc.) to make sure everything your script needs is ready to use. --Mark