From 80170728fdc44d9d871563b97b89fa8966ee9f52 Mon Sep 17 00:00:00 2001 From: jinqiang zhang Date: Thu, 28 Nov 2024 06:27:04 +0000 Subject: [PATCH] net-proxy/mihomo: add mihomo@.service Signed-off-by: jinqiang zhang --- net-proxy/mihomo/files/mihomo_at.service | 14 ++++++++++++++ ...omo-1.18.10.ebuild => mihomo-1.18.10-r1.ebuild} | 1 + 2 files changed, 15 insertions(+) create mode 100644 net-proxy/mihomo/files/mihomo_at.service rename net-proxy/mihomo/{mihomo-1.18.10.ebuild => mihomo-1.18.10-r1.ebuild} (95%) diff --git a/net-proxy/mihomo/files/mihomo_at.service b/net-proxy/mihomo/files/mihomo_at.service new file mode 100644 index 00000000000..6d1202007aa --- /dev/null +++ b/net-proxy/mihomo/files/mihomo_at.service @@ -0,0 +1,14 @@ +[Unit] +Description=mihomo Daemon for %i. +After=network.target NetworkManager.service systemd-networkd.service iwd.service + +[Service] +Type=exec +User=%i +CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE +Restart=on-abort +ExecStart=/usr/bin/mihomo + +[Install] +WantedBy=multi-user.target diff --git a/net-proxy/mihomo/mihomo-1.18.10.ebuild b/net-proxy/mihomo/mihomo-1.18.10-r1.ebuild similarity index 95% rename from net-proxy/mihomo/mihomo-1.18.10.ebuild rename to net-proxy/mihomo/mihomo-1.18.10-r1.ebuild index 608e76cb217..ab1caa730b9 100644 --- a/net-proxy/mihomo/mihomo-1.18.10.ebuild +++ b/net-proxy/mihomo/mihomo-1.18.10-r1.ebuild @@ -59,5 +59,6 @@ src_install() { dobin bin/mihomo dosym -r "/usr/bin/mihomo" "/usr/bin/clash-meta" systemd_dounit "${FILESDIR}/mihomo.service" + systemd_newunit "${FILESDIR}/mihomo_at.service" mihomo@.service newinitd "${FILESDIR}"/mihomo.initd mihomo }