Project

General

Profile

Bug #1388

[pacman2pacman]: should support other init systems than systemd

xylon - over 2 years ago - . Updated 10 months ago.

Status:
fixed
Priority:
feature
Assignee:
-
% Done:

0%


Description

ATM it checks if transmission is running using systemd. We need to support other init systems like OpenRC.

History

#1

Updated by Elon_Satoshi over 2 years ago

I would simply replace line 54 in pacman2pacman-get with `if ! pidof transmission-daemon > /dev/null`.

Edit: To test this out, step by step:

1. Open /usr/bin/pacman2pacman-get as root with your favorite text editor, preferably with line numbering.
2. Replace line 54 with 'if ! pidof transmission-daemon > /dev/null', save and exit
3. If transmission isn't installed, install it now with 'pacman -S transmission-cli'. If you use openrc, run 'pacman -S transmission-openrc'
4. Open /etc/pacman.conf with your favorite text editor as root.
5. Write "XferCommand = pacman2pacman-get u %o" under [options], save and exit
6. If you're on systemd, run 'systemctl start transmission' as root. If you're on openrc, run 'rc-update add transmission-daemon default &x%x
openrc default' as root.
7. Run 'pacman -Syu'as root. Expected result:

Pacman2pacman http download: core.db: file not modified
Pacman2pacman http download: core.db.sig: failed
Pacman2pacman http download: extra.db: file not modified
Pacman2pacman http download: extra.db.sig: failed
Pacman2pacman http download: community.db: file not modified
Pacman2pacman http download: community.db.sig: failed

8. Run 'transmission-remote --exit' or 'systemctl stop transmission' if you have SystemD
9. Run 'pacman -Syu' as root. Expected result:

Error: The transmission daemon is not running.
Error: The transmission daemon is not running.
Error: The transmission daemon is not running.
Error: The transmission daemon is not running.
Error: The transmission daemon is not running.
Error: The transmission daemon is not running.
Error: The transmission daemon is not running.
Error: The transmission daemon is not running.
Error: The transmission daemon is not running.
Error: The transmission daemon is not running.
error: failed to update nonprism (error invoking external downloader)

#2

Updated by xylon over 2 years ago

That looks like it should work. However all changes need to be tested, and I don't have time to test it since I don't use other init systems myself and I'm starting a new job next week so will be busy.

Someone needs to test this with both systemd and OpenRC, each with transmission running and not running.

#3

Updated by Elon_Satoshi over 2 years ago

I've been using it like this on OpenRC, it failed to run (with the apropriate error) just a while ago after I had shut down transmission-daemon because the wifi wasn't working. I ran transmission-daemon and ran pacman again, successfully.

If you don't add the `> /dev/null` part, the program will spam the PID of transmission-daemon. But even with the PID redirected to null, `pidof` still returns true or false for the if command.

This method should work even if you're using Microsoft Linux Initializer Pro Edition or something.

I'll ask someone on IRC to test it with systemd. Good luck with your new job!

#4

Updated by botho over 2 years ago

Elon_Satoshi wrote:

I would simply replace line 54 in pacman2pacman-get with `if ! pidof transmission-daemon > /dev/null`.

This works with systemd

#5

Updated by Elon_Satoshi over 2 years ago

Are the .sig errors normal?
`Pacman2pacman http download: core.db.sig: failed `

#6

Updated by lukeshu over 2 years ago

I'm not too familiar with pacman2pacman, but we don't sign the .db files.

#7

Updated by botho over 2 years ago

Weird pacman2pacman checks for it then, no ?

#8

Updated by xylon over 2 years ago

I released a new version the other day which should fix this bug. Can someone please confirm as my Parabola is broken since kernel update and I have no time to fix it right now.

#9

Updated by josealberto4444 10 months ago

I can confirm that it works perfectly when using OpenRC. I'd change also the installation message:

transmission-daemon need to be running for pacman2pacman to work:
systemctl start transmission
systemctl enable transmission

to this:

transmission-daemon need to be running for pacman2pacman to work.

If you use systemd:
systemctl start transmission
systemctl enable transmission

If you use OpenRC:
rc-service transmission-daemon start
rc-update add transmission-daemon default

I've updated the wiki accordingly.

#10

Updated by bill-auger 10 months ago

  • Status changed from open to fixed
  • Subject changed from It should support other init systems than systemd to [pacman2pacman]: should support other init systems than systemd

done - thanks jose

Also available in: Atom PDF