From owner-freebsd-questions@freebsd.org Sat Aug 22 07:58:52 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 420BF3B16C4 for ; Sat, 22 Aug 2020 07:58:52 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4BYW3w0Ht6z4HrT for ; Sat, 22 Aug 2020 07:58:52 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: by mailman.nyi.freebsd.org (Postfix) id 0A1463B179D; Sat, 22 Aug 2020 07:58:52 +0000 (UTC) Delivered-To: questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09DFB3B171D for ; Sat, 22 Aug 2020 07:58:52 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BYW3t0xwPz4JMF for ; Sat, 22 Aug 2020 07:58:49 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([178.12.118.210]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPA (Nemesis) id 1MHX7f-1kMswI0fIn-00DZdC; Sat, 22 Aug 2020 09:58:47 +0200 Date: Sat, 22 Aug 2020 09:58:46 +0200 From: Polytropon To: Odhiambo Washington Cc: questions Subject: Re: creating a startup script for a foreign application Message-Id: <20200822095846.a8891dda.freebsd@edvax.de> In-Reply-To: References: Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:KfUqmp3fo1wu/4EaersKo46l613+Q2L7TDk6TwzTkWy5Rs5Kqf6 DS4BcATxFP8Fm71zQPqEPBJTuyiFmEtBISFhDvv4X2p/zKv1EGGeVvtUqT0sUETyBJxaIM7 m5jUhcyxHLAo5mis90yJtUHayJagkVgfDqmjk21aaDY5ynSwuFZ2eShYTgRGCMNJw5W8NQx nAKc+NbmRYMbfJuYrZs8Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:D3QwOR/9/fE=:eX9aFWUeNwWDrRdIWql0UO Tfg2q1YBbjiiX5ViMQAM5rMA8cq0KCKN13bltEPoZ7RCap1jqPcv0M5XCmh/c2riN+OJ1I/75 i5QYB5xy+nTNButZgVnx5wKRmagWwtWHua3Fzj2/KrxT7hv/EXxB3YK5uc1QhqIfa+VlPPAC3 r6x64yldfVAfgpbxkqdnrVKsPRwIlBnaDdtNDcjB6kgbTQcE/y4owuFCsmwYTFbYt3pwu6t+c l5WouHSikMb7IeZqGqnPrUVkWrTADwCIVtZHALl1b2hbF0b8/OHfCk8MhPIzNzB28U8PGFhK/ Wj7FTVYLVDJUyOCgHcCPKUTOwpYOt+3AL/w+kHo6UNH3iNwff7WFis+7yeIb5ycQn4chVSA+r 1KIC2+dyMPq9dfnR7c0KjMj99k/yjLlxz75l34DabOuLG2v81iSrqj1wsfvXAKIL3ExrlkSAC ZBUew28lGOoG+T8oOQysvFied+autdrCVVHwA4JQFPoRZZU6LjTXlbvt+EiS2XrPrD624QUS+ U6nAXRDJPwo7bPAPgygRfTZmNAPMgOCW8rOOFjtK1S1QWGYN7CINAsxfWyrxf8w73oI2UMU8x EHPnvDsWUVCtzKX8pGMLNDqFjG4TV+kzs+LDkz6Fqi+1PWIdyJe0hEV6JuxtpjIbCRMXvQmLL 6t2VZEqt6i1/XTtm8MzoUb4UPB3ciMgsqrpNVf3uFe3LzgL6gAq6inxyzgsRj1k05p2fHFjXb Xmjy0copIyTf99d/UySfHuGOqTs/44mtyXPHzACLddOAth3eDkqj9jp6HGroxF6nLeqlTPlA8 We0B/VPVdm+HoTaubcK7Nx5NVbeKcRML5ofQ/St3No+bUPxmMhOd1fVnxHVRu8bWmr/gz4FjF na813QzmgGNnMl1cP39VF7jERX5NGPF6PRjyO4KJRa09mhCHsuPjmvubh4KcJoLYINxgP3VxM +4N0C+nxP9IElRWgRxjY9o9bYbxE8CGp9uHh4VCL7aAzrTOazO8+daD2KpuKIUYxZjVriN+a0 iDugmLYulzmFzJcL9vdQBnlchAbt/S+6Amk4wza86RYi2wHHmuTeqZZy4M5bkOct2Ufkz8wZ6 YJzEBq1awKaZIkMEVL+57Mf2eD8Z/6xmsfZcrd9nWSis0zewAxUoEAB+L7FivMgh70Pia0R3m ZJ0PNEs8vCkp1KyrBdyTSVSMF+cfqp3S2WrrEIre3fiTwi8hKIZ2kapQkCswT/m25x/QDsyEX LjUNHy+KF7kIs7qsU X-Rspamd-Queue-Id: 4BYW3t0xwPz4JMF X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 217.72.192.74) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [2.34 / 15.00]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; RCVD_VIA_SMTP_AUTH(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.06)[-0.059]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[178.12.118.210:received]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:217.72.192.0/20, country:DE]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[217.72.192.74:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[217.72.192.74:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2020 07:58:52 -0000 On Sat, 22 Aug 2020 10:10:46 +0300, Odhiambo Washington wrote: > Hi good people, > > I am looking for assistance in creating a startup script for rc.d/ to > automatically start/stop a service upon reboot. > I have installed Mailman3.x in a python virtual environment and I have > adopted a script from Linux to control it. > I am able to use the script to manually start|stop the application. > However, it does not work when I reboot the system. > > Hoping someone can help me tinker with it so that it works with system > reboots. Without having had a closer look, I can immediately see that it is missing the header typical for all rc.d/ scripts, and it declares requiring bash, while I don't see anything bash-specific, so sh should be sufficient. For the general structure, you could examine scripts in /etc/rc.d/ (system scripts) and /usr/local/etc/rc.d/ (3rd party scripts). The REQUIRE: comment should probably contain "DAEMON" and "netif". Everything else looks quite "Linux-like" and does not really compare to the FreeBSD equivalents of rc.d/ style scripts, which first source /etc/rc.subr, sets a few variables, and then declares functions. You can adapt most of the content of the Linux-like version to conform to those requirements. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...