Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add systemd #212

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add systemd #212

wants to merge 1 commit into from

Conversation

taotieren
Copy link

@taotieren taotieren commented Dec 25, 2023

现在主流 Linux 选择 systemd 管理系统

  • 增加 Linux 支持的 systemd 版本状态
  • 增加 github520 systemd 自动更新 /etc/hosts 服务
  • 增加 github520 systemd 自动移除 /etc/hosts 修改服务
  • 增加 github520 systemd root 权限处理
  • 解决 github520 下载异常断开 curl 替换为 wget 方式
  • 增加 github520 systemd wget 双地址下载
  • 增加 github520 systemd 定时服务
  • 增加 github520 systemd 安装和使用说明
  • 增加 AUR 的 github520-git 包

@taotieren taotieren force-pushed the systemd branch 6 times, most recently from dd3a0d4 to f8ccf2f Compare December 25, 2023 10:06
@taotieren
Copy link
Author

@521xueweihan @521hellogithub 能否合并进主仓库呢?谢谢。

@521xueweihan
Copy link
Owner

521xueweihan commented Dec 28, 2023

@taotieren 这个是不是有点复杂了,会搞这些的至少得是个程序员,这么算起来不符合目标用户群体。

@taotieren
Copy link
Author

taotieren commented Dec 28, 2023

@taotieren 这个是不是有点复杂了,会搞这些的至少得是个程序员,这么算起来不符合目标用户群体。

这个是用的 Linux 自带的 systemd 服务,只是编写了相应的服务文件,用户手动安装下,就能根据用法中说明自动化处理。用户只需要照着复制下命令行操作下就行了,家里只要有网的情况下就能一致保持自动更新,还能通过 systemd 的 log 服务看到相应的更新 log ,有问题也能复制 log 出来反馈。

通过 systemd 包状态也能看出来主流 linux 基本都支持 systemd

@taotieren taotieren force-pushed the systemd branch 3 times, most recently from b082d66 to 8839a02 Compare December 28, 2023 10:42
Copy link
Contributor

@wuyuncheng-26 wuyuncheng-26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是……太复杂了?

@taotieren
Copy link
Author

taotieren commented Dec 29, 2023

是不是……太复杂了?

现在 systemd 是主流的管理方式,其实大部分操作是 systemd 的标准用法,用户只需要导入 update-github520-hosts.service remove-github520-hosts.service update-github520-hosts.timer 这三个文件到本地系统,剩下的就是 systemctl 之类的通用操作。

Arch Linux 的 systemd 使用说明

image

@taotieren
Copy link
Author

是不是……太复杂了?

觉得复杂很大可能是没接触 systemd 管理系统服务的操作,可能是停留在用 initd 之类的方式管理系统,这部分的知识可以尝试更新到 systemd 上。
可以在你的系统中运行 systemctl status 看看你的系统有没有在运行 systemd 服务

@wuyuncheng-26
Copy link
Contributor

首先,普通用户就不经常使用 Linux。其次,用户看到一条命令搞定的肯定都选它。虽然 systemctl 是通用的,但是 crontab 也是通用的呢~

@wuyuncheng-26
Copy link
Contributor

不是说我不懂 systemd,只是因为 crontab 更好用

@mylovesaber
Copy link

兄弟你这操作从配置角度来说相对合理,但过于复杂了,我写的脚本目的是把作者本身介绍的各种操作以及更新过程中可能出现的各种报错情况一并解决,从用户层面屏蔽除运行那行安装命令以外的一切操作,你那操作就好比是把我脚本功能全拆分成手动实现原理,小白谁受得了?而且路由器是init.d或者其他形式,你systemd没法通吃的,我有单独的文档介绍路由器怎么配置是我没有软路由单独测试,否则也一并合并了

@bond-aspecta
Copy link
Contributor

我觉得很棒, 但兄台可否打包成 homebrew 的包, 提交到 homebrew 仓库, 还要把这个更新的源做成可配置的. 比芯比芯~

@mylovesaber
Copy link

我觉得很棒, 但兄台可否打包成 homebrew 的包, 提交到 homebrew 仓库, 还要把这个更新的源做成可配置的. 比芯比芯~

老哥,mac没有systemd...只有linux主流发行版用的systemd,他把那东西做成包的话传给brew没人用得了。。。

@taotieren
Copy link
Author

兄弟你这操作从配置角度来说相对合理,但过于复杂了,我写的脚本目的是把作者本身介绍的各种操作以及更新过程中可能出现的各种报错情况一并解决,从用户层面屏蔽除运行那行安装命令以外的一切操作,你那操作就好比是把我脚本功能全拆分成手动实现原理,小白谁受得了?而且路由器是init.d或者其他形式,你systemd没法通吃的,我有单独的文档介绍路由器怎么配置是我没有软路由单独测试,否则也一并合并了

可以等其他用户 PR 一个 init.d 的配置,这个是方便 systemd 方式管理的 Linux 用户。

@taotieren
Copy link
Author

我觉得很棒, 但兄台可否打包成 homebrew 的包, 提交到 homebrew 仓库, 还要把这个更新的源做成可配置的. 比芯比芯~

你可以参考 homebrew 那边的系统管理方式编写一个适合的脚本来管理这些。

@mylovesaber
Copy link

兄弟你这操作从配置角度来说相对合理,但过于复杂了,我写的脚本目的是把作者本身介绍的各种操作以及更新过程中可能出现的各种报错情况一并解决,从用户层面屏蔽除运行那行安装命令以外的一切操作,你那操作就好比是把我脚本功能全拆分成手动实现原理,小白谁受得了?而且路由器是init.d或者其他形式,你systemd没法通吃的,我有单独的文档介绍路由器怎么配置是我没有软路由单独测试,否则也一并合并了

可以等其他用户 PR 一个 init.d 的配置,这个是方便 systemd 方式管理的 Linux 用户。

macos不用init.d也不用systemd,用的是plist,但有学习成本啊,我那脚本虽然没用plist但测试支持到big sur,只是macos设计成了有只读系统的状态,所以一升级就得重新运行一下,后面的版本就暂时没测试了,后来发现还是挂梯子实在点...

@taotieren
Copy link
Author

兄弟你这操作从配置角度来说相对合理,但过于复杂了,我写的脚本目的是把作者本身介绍的各种操作以及更新过程中可能出现的各种报错情况一并解决,从用户层面屏蔽除运行那行安装命令以外的一切操作,你那操作就好比是把我脚本功能全拆分成手动实现原理,小白谁受得了?而且路由器是init.d或者其他形式,你systemd没法通吃的,我有单独的文档介绍路由器怎么配置是我没有软路由单独测试,否则也一并合并了

可以等其他用户 PR 一个 init.d 的配置,这个是方便 systemd 方式管理的 Linux 用户。

macos不用init.d也不用systemd,用的是plist,但有学习成本啊,我那脚本虽然没用plist但测试支持到big sur,只是macos设计成了有只读系统的状态,所以一升级就得重新运行一下,后面的版本就暂时没测试了,后来发现还是挂梯子实在点...

我这是xx不稳定的时候的备用方案,所以才会有定时更新和一键清除的配置。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants