From nobody Sat Jun 03 10:16:30 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QYG4G4l5Gz4ZCpn; Sat, 3 Jun 2023 10:16:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QYG4G4D3Cz3PqS; Sat, 3 Jun 2023 10:16:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685787390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LgUVsGwtoouLOklI30yu7NT4szs53EmAEIYQfRuWBmk=; b=ue8bxZCuB18qclh18yyv2OfJb6lIHTgRIyLiqBbVruOpBAmJ3prZDu8hUvglgH3QXgcMSE rqRRp3by/mD0fPxdonu99jT/tnAyIDA76TJuzNfPgBJMphc0e+kLnXQeAzmMbxCRP5UIll 1xRZqoq7yaiNrtPv+lSvDhi9iT8yQuHLOO0+ImtTBrK4q13PYZC+fb7RfRH6t3jYjz92Qc +/s+AQ6kRBJdBdwdlzGCg49oa5SNzzSyKvWe7pR9nPdSbUfrOsRZJGyFJEGMrse9ZUA5eF jrxwlRmg9oDUJtYv87uyXmdSJpqukPSSuHxUcIA2nnRIWT6eE3dlLWbJPkJ//Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685787390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LgUVsGwtoouLOklI30yu7NT4szs53EmAEIYQfRuWBmk=; b=XcNJAwXCUShaVImTjOCcu7B6W53N95P8rGfExAJsGv1jLoUfHKlLLKMczp3ZgvWLDyymqG IrA5AyTUcGzYusIVS22R6frdUo5O8fjBLkk4wyMF+VmgZbfybAYnYmxWnfNMPT9ZQE5AiJ vgM+zV5yOzUm2XIGe5X+kUKE9UqJisf48lCjRrWeNv+JGztF7CPfeCWDwO4f1ZNa0fuLRO gy1o+t9lLWVajXDB6mxOwyJT0Wv5+IGCU3hw5rwAxgWf9VQqn/ffptpF5e/DIgtw1rrvjl BCw5YWYuaHTO9eRmFBAZM2x+La+RY7WKDj4geMLKu2UOHkyT9v5LICfyJv42FA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685787390; a=rsa-sha256; cv=none; b=AfINP1tUBcCLWr7s7pe1T0Bkje9Mzvjtr4SkDdhDQk9BnOYp5VG292VpQFqiM4TN/bOMsC sjykLmlOxH7Bt40dN3RzhsOlembAFmngknHuojosfcGg4nKCk3ZD2Bd4ewjyS2pAdAsDyi it11et0Qk1YG3KzlpnCtzGeuFCTMGH81eexNEW4TMb61a1LRyKVBObgXUdcD5qINiFap7k VRvw8Jed/xOJ8m6uphSTYkzf1PJ5ncw4olwR8FUu+4BnltnwQr4CI7KKJ3FqmTPX9deRkW c/f4yc2w4BxAOqnO9xjNB+fqoyXhXiWJhY2/CM6cW5PEc1cGNtLP5MGL4A4BOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QYG4G3GddzMPX; Sat, 3 Jun 2023 10:16:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 353AGURn041925; Sat, 3 Jun 2023 10:16:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 353AGU1K041924; Sat, 3 Jun 2023 10:16:30 GMT (envelope-from git) Date: Sat, 3 Jun 2023 10:16:30 GMT Message-Id: <202306031016.353AGU1K041924@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Nuno Teixeira Subject: git: 1044fe65f12a - main - net-p2p/amule: Modernize rc script List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eduardo X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1044fe65f12a1885352cab5a155c3634ed4d0f02 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by eduardo: URL: https://cgit.FreeBSD.org/ports/commit/?id=1044fe65f12a1885352cab5a155c3634ed4d0f02 commit 1044fe65f12a1885352cab5a155c3634ed4d0f02 Author: Nuno Teixeira AuthorDate: 2023-06-03 10:14:14 +0000 Commit: Nuno Teixeira CommitDate: 2023-06-03 10:14:14 +0000 net-p2p/amule: Modernize rc script PR: 266866 Reported by: echoxxzz@gmail.com --- net-p2p/amule/Makefile | 2 +- net-p2p/amule/files/amuled.in | 54 ++++++++----------------------------------- 2 files changed, 11 insertions(+), 45 deletions(-) diff --git a/net-p2p/amule/Makefile b/net-p2p/amule/Makefile index 2689353f4092..6e5e6c511408 100644 --- a/net-p2p/amule/Makefile +++ b/net-p2p/amule/Makefile @@ -1,6 +1,6 @@ PORTNAME= amule PORTVERSION= 2.3.3 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= net-p2p MASTER_SITES= SF/${PORTNAME}/aMule/${PORTVERSION} DISTNAME= aMule-${PORTVERSION} diff --git a/net-p2p/amule/files/amuled.in b/net-p2p/amule/files/amuled.in index 5c1cdb745f74..53c6c28da255 100644 --- a/net-p2p/amule/files/amuled.in +++ b/net-p2p/amule/files/amuled.in @@ -1,8 +1,5 @@ #!/bin/sh -# aMule RCng startup script -# Ogirinal work from Gabriele Cecchetti (amule.org forum) -# # PROVIDE: amuled # REQUIRE: NETWORKING SERVERS # BEFORE: DAEMON @@ -13,8 +10,8 @@ # Set it to "YES" to enable amuled # amuled_user (str): Set to user running amuled # (default 'aMule') -# amuled_home (str): Set to home directory of user running amuled -# (default /home/${amuled_user}) +# amuled_config (str): Set to home directory of user running amuled +# (default /home/${amuled_user}) . /etc/rc.subr @@ -23,45 +20,14 @@ rcvar=amuled_enable load_rc_config $name -[ -z "$amuled_enable" ] && amuled_enable="NO" -[ -z "$amuled_user" ] && amuled_user="aMule" -[ -z "$amuled_home" ] && amuled_home="/home/${amuled_user}" +: ${amuled_enable="NO"} +: ${amuled_user:="amule"} +: ${amuled_config:="/home/${amuled_user}/.aMule"} -required_dirs=${amuled_home} -required_files="${amuled_home}/.aMule/amule.conf" - -start_cmd="${name}_start" -stop_cmd="${name}_stop" - -amuled_start() -{ - if [ ! -f /var/run/${name}.run ] - then - su -l ${amuled_user} -c "amuled &" 2>>/var/log/${name}.log >>/var/log/${name}.log && touch /var/run/${name}.run - echo "Started ${name}." - echo `date` : "Started ${name}." >> /var/log/${name}.log - else - echo "${name} seems to be already running -- remove /var/run/${name}.run manually if needed." - fi -} - -amuled_stop() -{ - if [ -f /var/run/${name}.run ] - then - # The following line is much better, but doesn't stop totally amuled - # su -l ${amuled_user} -c "amulecmd -c Shutdown" 2>>/var/log/${name}.log >>/var/log/${name}.log - # Since amuled catches SIGTERM, this way is preferred for now - killall -TERM amuled 2>>/var/log/${name}.log >>/var/log/${name}.log ; sleep 3 - killall -KILL amuled 2>>/var/log/${name}.log >>/var/log/${name}.log - # Also kill amuleweb if needed - killall -KILL amuleweb 2>/dev/null >/dev/null - rm -f /var/run/${name}.run - echo "Stopped ${name}." - echo `date` : "Stopped ${name}." >> /var/log/${name}.log - else - echo "${name} doesn't seem to be running -- create /var/run/${name}.run if needed." - fi -} +pidfile="${amuled_config}/amuled.pid" +procname="/usr/local/bin/amuled" +required_files="${amuled_config}/amule.conf" +command="/usr/sbin/daemon" +command_args="-f -p ${pidfile} ${procname} --config-dir=${amuled_config}" run_rc_command "$1"