From nobody Tue Jan 23 00:10:21 2024 X-Original-To: freebsd-questions@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 4TJnYH3ztlz58VCk for ; Tue, 23 Jan 2024 00:10:43 +0000 (UTC) (envelope-from freebsd@gushi.org) Received: from prime.gushi.org (prime.gushi.org [IPv6:2620:137:6000:10::142]) (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 (2048 bits) client-digest SHA256) (Client CN "prime.gushi.org", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TJnYH108lz4p4v for ; Tue, 23 Jan 2024 00:10:42 +0000 (UTC) (envelope-from freebsd@gushi.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple ([IPv6:2601:602:87f:b05d:95b9:8b22:c949:a7ae]) (authenticated bits=0) by prime.gushi.org (8.17.2/8.17.2) with ESMTPSA id 40N0AbLw077602 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Jan 2024 00:10:38 GMT (envelope-from freebsd@gushi.org) DKIM-Filter: OpenDKIM Filter v2.10.3 prime.gushi.org 40N0AbLw077602 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gushi.org; s=prime2014; t=1705968638; bh=TsDd15JxOYOUM+BsK2KSiWi6vbtKCpDOmvmgp4b5Nyw=; h=Subject:From:In-Reply-To:Date:Cc:References:To; z=Subject:=20Re:=20User=20specific=20daemons|From:=20Dan=20Mahoney= 20|In-Reply-To:=20<20240122175118.1ef3b25e@venu s.private.rrbrussell.com>|Date:=20Mon,=2022=20Jan=202024=2016:10:2 1=20-0800|Cc:=20freebsd-questions@freebsd.org|References:=20<20240 122175118.1ef3b25e@venus.private.rrbrussell.com>|To:=20"Robert=20R .=20Russell"=20; b=ZN4lUWHE5tc/QwN3oT3iTw2xLo1eKo8aeyTo3/obyeW8CTFHESjcSLguFGQNeg5We X2irtVADzYaIAldtGhkZIDNWoAwEk4laHqfV0g2h/tPgGBHuxk+kXySKUsx/sSOCD+ BXEeztG73uci4Bhq8nH9txzzOWpgqsVKZzNMplRNrskVgYGuq/z0JemulNCbvNVJOZ dfLDAIuxO5nFJrNtPQVHIvsp2+2vVG1+4VKTU0p3r4qDU9QxmO+RArIwzJYOdmx8W/ y3xzoSqyBxkAlDuO3HbjohZWphzW32uAS5Z1MqIssreJCsDO2o2ndvjj9XsylCjboT ubwnrauSkrudQ== X-Authentication-Warning: prime.gushi.org: Host [IPv6:2601:602:87f:b05d:95b9:8b22:c949:a7ae] claimed to be smtpclient.apple Content-Type: text/plain; charset=us-ascii List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Re: User specific daemons From: Dan Mahoney In-Reply-To: <20240122175118.1ef3b25e@venus.private.rrbrussell.com> Date: Mon, 22 Jan 2024 16:10:21 -0800 Cc: freebsd-questions@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20240122175118.1ef3b25e@venus.private.rrbrussell.com> To: "Robert R. Russell" X-Mailer: Apple Mail (2.3774.300.61.1.2) X-Rspamd-Queue-Id: 4TJnYH108lz4p4v X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:393507, ipnet:2620:137:6000::/44, country:US] > On Jan 22, 2024, at 15:51, Robert R. Russell = wrote: >=20 > How do I start and maintain a program as a user specific daemon? I > don't mean run a daemon as a specific user. I need one of each daemon > per user. >=20 > Under Linux I could create a few $HOME/.config/systemd/daemon.service > files run systemctl --user enable daemon.service and the problem was > solved. The services specifically include tmux, and ssh-agent or > gpg-agent. There were some other services I used this for but those = were > more Linux specific and thus less important. >=20 > Before I go with the metaphorical hammer meets nail shaped object > approach and port half of SystemD to FreeBSD using Rust what options > should I try first. I would do this with an @reboot cron job, which stepped over a list of = users (you don't want *all* users, you want all the users in some = group), and then fired those processes up. If you really need those processes to restart, wrapper them with = daemon(1). -Dan=