Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L libpamac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 7
    • Issues 7
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ApplicationsApplications
  • libpamac
  • Issues
  • #25
Closed
Open
Issue created Nov 15, 2022 by Tripple Moon@TriMoon🤓

[RFE] pamac-mirrorlist.service

Im suggesting an improvement to this service unit, to allow using local-admin-configuration of the passed options to pacman-mirrors, plus other useful extras.

I would have created a MR, but seems we are unable to make a personal clone on your GitLab instance, which is needed for this functionality...

Anyhow, here is the proposed contents of pamac-mirrorlist.service

[Unit]
Description=Generate mirrorlist
Wants=network-online.target
After=network-online.target

[Service]
Environment='PMOptions=-f8'
#Environment='PMOptions=--continent'

Type=oneshot
ExecStartPre=/usr/bin/pacman-mirrors --quiet $PMOptions
ExecStart=/usr/bin/pacman-mirrors --status
ExecStartPost=/usr/bin/pacman -Sy
  • The options tobe used can be set in the Environment line, or overridden using drop-in configs as usual without the need to change the exec line(s).
    (See systemd.exec#Environment and systemd.service#Command lines)
  • The ExecStart line containing --status is just so the output of that invocation will be written to the logs, which will be handy for the admin.
    Plus it reflects the name of the service better 😉
  • The last line is the recommended command to run after any change to the mirror list.
    I didnt use -Syu on purpose because that would trigger an auto-upgrade without the admins consent. 😉

I currently use a drop-in to override the current service file, but would be nice to have this for everyone by default.
(I'm using the --continent option instead...)

Example run on my machine

# /usr/lib/systemd/system/pamac-mirrorlist.service
[Unit]
Description=Generate mirrorlist
Wants=network-online.target
After=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/bin/pacman-mirrors -f8

# /etc/systemd/system/pamac-mirrorlist.service.d/override.conf
[Service]
#Environment='PMOptions=-f8'
Environment='PMOptions=--continent'

ExecStartPre=/usr/bin/pacman-mirrors --quiet $PMOptions
ExecStart=
ExecStart=/usr/bin/pacman-mirrors --status
ExecStartPost=/usr/bin/pacman -Sy
Nov 15 12:52:39 manjaro systemd[1]: Starting Generate mirrorlist...
Nov 15 12:53:45 manjaro pacman-mirrors[20740]: ::INFO => Mirror pool: https://repo.manjaro.org/mirrors.json
Nov 15 12:53:45 manjaro pacman-mirrors[20740]: ::INFO => Mirror status: https://repo.manjaro.org/status.json
Nov 15 12:53:45 manjaro pacman-mirrors[20740]: ::INFO User generated mirror list
Nov 15 12:53:45 manjaro pacman-mirrors[20740]: ::------------------------------------------------------------
Nov 15 12:53:45 manjaro pacman-mirrors[20740]: ::INFO Custom mirror file saved: /var/lib/pacman-mirrors/custom-mirrors.json
Nov 15 12:53:45 manjaro pacman-mirrors[20740]: ::INFO Using default mirror file
Nov 15 12:53:45 manjaro pacman-mirrors[20740]: ::INFO Querying mirrors - This may take some time
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Local mirror status for stable branch
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #1   OK  06:14   Turkey       http://ftp.linux.org.tr/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #2   OK  06:12   Georgia      http://manjaro.grena.ge/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #3   OK  01:50   India        https://mirror.albony.xyz/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #4   OK  03:09   Iran         https://mirror.bardia.tech/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #5   OK  00:20   Singapore    https://mirror.freedif.org/Manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #6   OK  06:12   Georgia      https://repos.silknet.com/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #7   OK  00:20   Japan        http://ftp.tsukuba.wide.ad.jp/Linux/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #8   OK  01:43   Singapore    http://ossmirror.mycloud.services/os/linux/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #9   OK  08:00   Philippines  http://mirror.rise.ph/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #10  OK  05:10   Japan        https://mirrors.xtom.jp/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #11  OK  05:11   Thailand     https://mirror.kku.ac.th/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #12  OK  01:51   Taiwan       https://mirror.archlinux.tw/Manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #13  OK  01:50   South_Korea  https://mirror.funami.tech/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #14  OK  06:12   China        https://mirrors.ustc.edu.cn/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #15  OK  00:20   Singapore    https://mirror.guillaumea.fr/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #16  OK  06:12   China        https://mirrors.huaweicloud.com/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #17  OK  01:39   China        https://mirrors.sjtug.sjtu.edu.cn/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #18  OK  04:00   Singapore    https://download.nus.edu.sg/mirror/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #19  OK  06:12   China        https://mirrors.tuna.tsinghua.edu.cn/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #20  OK  06:12   China        https://mirrors.tuna.tsinghua.edu.cn/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #21  OK  05:10   Bangladesh   http://mirror.xeonbd.com/manjaro/
Nov 15 12:53:46 manjaro pacman-mirrors[20750]: Mirror #22  OK  01:47   Bangladesh   https://bd.mirror.vanehost.com/Manjaro/
Nov 15 12:53:46 manjaro pacman[20752]: :: Synchronizing package databases...
Nov 15 12:53:46 manjaro pacman[20752]:  core downloading...
Nov 15 12:53:46 manjaro pacman[20752]:  extra downloading...
Nov 15 12:53:46 manjaro pacman[20752]:  community downloading...
Nov 15 12:53:46 manjaro pacman[20752]:  multilib downloading...
Nov 15 12:53:46 manjaro systemd[1]: pamac-mirrorlist.service: Deactivated successfully.
Nov 15 12:53:46 manjaro systemd[1]: Finished Generate mirrorlist.
Nov 15 12:53:46 manjaro systemd[1]: pamac-mirrorlist.service: Consumed 2.960s CPU time, received 3.9M IP traffic, sent 142.8K IP traffic.
Edited Nov 15, 2022 by Tripple Moon
Assignee
Assign to
Time tracking