• Bug#1107259: /etc/cron.d/apt-mirror2 can't append log

    From xiao sheng wen@21:1/5 to All on Wed Jun 4 05:30:01 2025
    Package: apt-mirror2
    Version: 13-2
    Severity: minor
    X-Debbugs-Cc: atzlinux@debian.org

    Hi,

    When I enable apt-mirror2 cron in /etc/cron.d/apt-mirror2,

    I can't get any log about apt-mirror2 execute in $base_path/var.

    The /etc/cron.d/apt-mirror2 use > /dev/null to diable the log output.

    This is not a good idear. The log should keep.

    I had try to delete "> /dev/null" in /etc/cron.d/apt-mirror2,
    I can get the log in logfile under $base_path/var, but the logfile
    can't appended.

    I suggest support append log.


    Thanks!
    xiao sheng wen

    -- System Information:
    Release: 12.11.0
    Codename: bookworm
    Architecture: x86_64

    Kernel: Linux 6.12.22+bpo-rt-amd64 (SMP w/16 CPU threads; PREEMPT)
    Locale: LANG=zh_CN.UTF-8, LC_CTYPE=zh_CN.UTF-8 (charmap=UTF-8), LANGUAGE=zh_CN:zh
    Shell: /bin/sh linked to /usr/bin/dash
    Init: systemd (via /run/systemd/system)
    LSM: AppArmor: enabled

    Versions of packages apt-mirror2 depends on:
    ii adduser 3.134
    ii python3 3.11.2-1+b1
    ii python3-apt-mirror2 13-1.1~bpo12+1

    apt-mirror2 recommends no packages.

    apt-mirror2 suggests no packages.

    -- no debconf information

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Yuri Konotopov@21:1/5 to All on Wed Jun 4 15:30:01 2025
    Hi!

    04.06.2025 07:23, xiao sheng wen пишет:
    Package: apt-mirror2
    Version: 13-2
    Severity: minor
    X-Debbugs-Cc: atzlinux@debian.org

    Hi,

    When I enable apt-mirror2 cron in /etc/cron.d/apt-mirror2,

    I can't get any log about apt-mirror2 execute in $base_path/var.

    I just checked fresh apt-mirror2 install and can not reproduce this issue.

    Are there any files under `$base_path/var`? It should contains `apt-mirror2.log` and one log file per mirror URL.


    The /etc/cron.d/apt-mirror2 use > /dev/null to diable the log output.

    This is not a good idear. The log should keep.

    I had try to delete "> /dev/null" in /etc/cron.d/apt-mirror2,
    I can get the log in logfile under $base_path/var, but the logfile
    can't appended.

    The output of command is silenced because apt-mirror2 write log files
    in addition to stdout.


    I suggest support append log.

    As of now apt-mirror2 mirrors apt-mirror behavior which rewrite log file
    every run.
    I think it can be made configurable though.



    Thanks!
    xiao sheng wen

    -- System Information:
    Release: 12.11.0
    Codename: bookworm
    Architecture: x86_64

    Kernel: Linux 6.12.22+bpo-rt-amd64 (SMP w/16 CPU threads; PREEMPT)
    Locale: LANG=zh_CN.UTF-8, LC_CTYPE=zh_CN.UTF-8 (charmap=UTF-8), LANGUAGE=zh_CN:zh
    Shell: /bin/sh linked to /usr/bin/dash
    Init: systemd (via /run/systemd/system)
    LSM: AppArmor: enabled

    Versions of packages apt-mirror2 depends on:
    ii adduser 3.134
    ii python3 3.11.2-1+b1
    ii python3-apt-mirror2 13-1.1~bpo12+1

    apt-mirror2 recommends no packages.

    apt-mirror2 suggests no packages.

    -- no debconf information


    --
    Best regards, Yuri Konotopov

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?eGlhbyBzaGVuZyB3ZW4o6IKW5@21:1/5 to Yuri Konotopov on Fri Jun 6 07:00:02 2025
    To: 1107259@bugs.debian.org

    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------gvfibnDPkM3fnRBjRHVJsSUt
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    Hi,

    在 2025/6/4 21:16, Yuri Konotopov 写道:
    Hi!

    04.06.2025 07:23, xiao sheng wen пишет:
    Package: apt-mirror2
    Version: 13-2
    Severity: minor
    X-Debbugs-Cc: atzlinux@debian.org

    Hi,

    When I enable apt-mirror2 cron in /etc/cron.d/apt-mirror2,

    I can't get any log about apt-mirror2 execute in $base_path/var.

    I just checked fresh apt-mirror2 install and can not reproduce this issue.

    Are there any files under `$base_path/var`? It should contains `apt-mirror2.log` and one log file per mirror URL.

    Yes, there two log files under under `$base_path/var`.

    I use root's crontab do a test again:

    crontab -l -u root

    */2 *    * * *    /usr/bin/apt-mirror2 > /dev/null

    The log output is exist. The "> /dev/null" don't affect whether  generate log files.



    The /etc/cron.d/apt-mirror2 use > /dev/null to disable the log output.

    This is not a good idear. The log should keep.

    I had try to delete "> /dev/null" in /etc/cron.d/apt-mirror2,
    I can get the log in logfile under $base_path/var, but the logfile
    can't appended.

    The output of command is silenced because apt-mirror2 write log files
    in addition to stdout.
    Yes.


    I suggest support append log.

    As of now apt-mirror2 mirrors apt-mirror behavior which rewrite log file every run.
    I think it can be made configurable though.
    Yes, rewrite log is the question.
    I suggest set append log as default configuration.


    Thanks!

    --
    肖盛文 xiao sheng wen -- Debian Developer(atzlinux)
    Debian QA page: https://qa.debian.org/developer.php?login=atzlinux%40debian.org GnuPG Public Key: 0x00186602339240CB


    --------------gvfibnDPkM3fnRBjRHVJsSUt--

    -----BEGIN PGP SIGNATURE-----

    wsF5BAABCAAjFiEEvGv7H5NUQYeSuhtTJ2Egg8PSprAFAmhCcfwFAwAAAAAACgkQJ2Egg8PSprDl TA/9E1XyspSVu1j960n7Oe1yaMldNJutcfkJbhugJqYK2xKQCiytxmYNjfak0PXLfwki8+f8DYw5 esG9OcLyku3l7RwUaT1FXECXgbFkNXRypy4RCtfvs91wOZ5mNOy3jRxKjyCuUvdK8GqYB9iU7SzZ CvzDSIo9mOQNXHz/WTe0qU+Pz2n9709sJc6IQwizQPX8RCYDQ6NNvwWNerhN9j7fyvj2Qp2lm3BQ ViGfJ41kBuKQb7M9F2R/EEhtvviLh/lylnH4kjWeN//ILsjRIYDLZqkBIMc5lWoQ581EgW2HDRRV 6e8f/Yp3fYju510Lbb8AevJCqM6pfKQHVn3fJW/DSEfzMmjXLs+ZkFU1rG3nwNBXaNfd+pOA8Mnf oBZuWxrd6wdTMG+n0tC7A6UvJTW3gBW9Nt2S6aGNQ8PT31qhjd/ToTeGC/I8n80CMsPk2+7n6YbP sP2JPZ3YHFdbvncAQNaije3harZ7dTL/S4CbXgBV0JEpJki6Rd+pZs608yxyt3XGo9SBSzQpoZgk +QHTAY8YkpDvixDbxUBK5pkebKxec44MaHLjt20ps9hVYMeplj/vBKRTP4CiDADrI5wOavqlqYTN 9DiykaYAnzjdDQvVGSSssx/Jd9NTCuvpvJFoTInWOzrr0VxQ+wraLQ/s/3YE8
  • From Yuri Konotopov@21:1/5 to All on Fri Jun 6 10:00:02 2025
    Here is the upstream patch: https://gitlab.com/apt-mirror2/apt-mirror2/-/merge_requests/201

    It adds a new `append_logs` setting to mirror.list, with the default
    value set to `off`. I don't think we should change the default behavior
    for all users.

    For example, in my case, log truncation is the expected behavior — I
    don't want my logs to grow too large.

    06.06.2025 08:43, xiao sheng wen(肖盛文) пишет:
    Hi,

    在 2025/6/4 21:16, Yuri Konotopov 写道:
    Hi!

    04.06.2025 07:23, xiao sheng wen пишет:
    Package: apt-mirror2
    Version: 13-2
    Severity: minor
    X-Debbugs-Cc: atzlinux@debian.org

    Hi,

    When I enable apt-mirror2 cron in /etc/cron.d/apt-mirror2,

    I can't get any log about apt-mirror2 execute in $base_path/var.

    I just checked fresh apt-mirror2 install and can not reproduce this issue. >>
    Are there any files under `$base_path/var`? It should contains `apt-mirror2.log` and one log file per mirror URL.

    Yes, there two log files under under `$base_path/var`.

    I use root's crontab do a test again:

    crontab -l -u root

    */2 *    * * *    /usr/bin/apt-mirror2 > /dev/null

    The log output is exist. The "> /dev/null" don't affect whether  generate log files.



    The /etc/cron.d/apt-mirror2 use > /dev/null to disable the log output.

    This is not a good idear. The log should keep.

    I had try to delete "> /dev/null" in /etc/cron.d/apt-mirror2,
    I can get the log in logfile under $base_path/var, but the logfile
    can't appended.

    The output of command is silenced because apt-mirror2 write log files
    in addition to stdout.
    Yes.


    I suggest support append log.

    As of now apt-mirror2 mirrors apt-mirror behavior which rewrite log file
    every run.
    I think it can be made configurable though.
    Yes, rewrite log is the question.
    I suggest set append log as default configuration.


    Thanks!



    --
    Best regards, Yuri Konotopov

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?eGlhbyBzaGVuZyB3ZW4o6IKW5@21:1/5 to Yuri Konotopov on Fri Jun 6 11:30:01 2025
    To: 1107259@bugs.debian.org

    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------jEUAATlQ8zcENxyAN0KmXfbb
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    Control: tags -1 upstream fixed-upstream

    在 2025/6/6 15:55, Yuri Konotopov 写道:
    Here is the upstream patch: https://gitlab.com/apt-mirror2/apt-mirror2/-/merge_requests/201

    It adds a new `append_logs` setting to mirror.list, with the default value set to `off`. I don't think we should change the default behavior for all users.

    For example, in my case, log truncation is the expected behavior — I don't want my logs to grow too large.

    It's also ok.

    Thanks for your quick response!

    Regards,

    --
    肖盛文 xiao sheng wen -- Debian Developer(atzlinux)
    Debian QA page: https://qa.debian.org/developer.php?login=atzlinux%40debian.org GnuPG Public Key: 0x00186602339240CB


    --------------jEUAATlQ8zcENxyAN0KmXfbb--

    -----BEGIN PGP SIGNATURE-----

    wsF5BAABCAAjFiEEvGv7H5NUQYeSuhtTJ2Egg8PSprAFAmhCstMFAwAAAAAACgkQJ2Egg8PSprCg Cw//czcNtNqG2TKeCndKPXIzx0QNoYa4rPQ1s0y+XbYhgAt0u1qSpDZWwPufckxe0sf3WeKpPjnS 0bWTdqJ/Q8/kuYpmN6c7UjhC/IgFLw50zLVOunx7Tu8/Ppp0PqHFMXupEmTphSCZK97V2E04+OCz +7+lbY5R0uABjQwTeNxMeCbDy0bt6XQuYsSz85c9cC1FmoxwwOK3xD4/qP00s7whZGywwXhrawEc 02WEufgMyf3KS620rdLfopXlKMHUAvppGWkGJbgxJyScUonm9CoN5kCKCsa5bnby9ikz0U/N+45q 5o+3OiAF4BmNw+VSo1/5Lj0Dv7g6kpYBNVO6OVeMci6Xjyby+Z9JqfAOd/+usKnmrGO3B8scX0Mm 7/Mkui5tnrGTMMzIlBX8U+f5OEzAmQd+5yKZLH5dwATdDQN7FQ72w7L96veMvPQYMY2oAQer6cFb Ynkh1J13ySVLmyhQ05yKG1Cngb16T0/Q8gBQlUiV6tQaoPWZYo7DHvyLLKEKXqN/qZd5DKqPmbSE hLYqCWNYY373TZyaFX0DJd5TUXDK+9fwMlHdTxe+RxrmypwRtSJuMJzPXVCzUZKscGHriTVb6/RD oRMLsSPwCWr9L9GycfXDZc8GdNpgngsfPX80tk3hkW7+VT2M0Tdd6SB1Xpv3e