I-Dream-in-Code / kde-arch-update-plasmoid

30 stars 9 forks source link

Error with AUR update - makepkg can't be run as root #9

Closed ghost closed 6 years ago

ghost commented 6 years ago

Updating AUR packages fails because the AUR helper (Trizen in my case) is run as root and makepkg fails if it is run as root. This could probably be corrected by running the AUR helper as the regular user instead of root.

I-Dream-in-Code commented 6 years ago

The same issue is for pacaur and it works fine for pacaur

I can try putting pexec user to force it to be run as a user instead of root

ghost commented 6 years ago

That's strange. Is pacaur also running as root?

I-Dream-in-Code commented 6 years ago

Pacaur quits automatically if run as root.

I dealt with that bug for a long when I tried to make aur updates run only in background. That's why it only runs in konsole to avoid the whole issue.

It might not be on my end and might be some specific pkgbuild issue.

Can you try running trizen manually and see if it fails?

Also please list the output of ps aux | grep trizen both running manual and through the plasmoid

ghost commented 6 years ago

pacaur automatically ask for credentials when it's run as user. It quits when run as sudo pacaur or pkexec pacaur but simple pacaur invoked as normal user should work (it will ask for pass to elevate privileges by itself)

I'm pretty sure that pacaur,yaourt and yay doesn't need/mustn't to be run as root (they elevate privileges when they need them), trizen would be another one.

Maybe it will be easier to find out which helpers must be run as root (if there is any) similar to pacman and by default invoking helpers as normal user.

I-Dream-in-Code commented 6 years ago

None of them are run as root or sudo

The command is konsole --hold -e *aur_helper* -Syu

I-Dream-in-Code commented 6 years ago

@fancytenseletters does pacaur fail for you?

I don't have any aur packages to update but when it updates what pacman should I doesn't fail.

So if it's an aur only issue I'll downgrade my own arch update notifier

ghost commented 6 years ago

No, everything is fine on my end (using pacaur). It's OP who said that his helper (trizen) runs as root.

I-Dream-in-Code commented 6 years ago

@fancytenseletters you had me worried for a sec haha

@guicale can you please post output of ps ayx | grep trizen before it finishes both manual and through plasmoid

ghost commented 6 years ago

I was trying to test the plasmoid again after updating it to the latest version and now it's causing a segmentation fault on Plasma Shell when I click "Update System" (with AUR enabled and disabled). I'll try to reinstall the plasmoid and report back on what happens. Sorry for all the trouble.

ghost commented 6 years ago

After reinstalling the segfault remains, so I can't report on the original issue, sorry.

I-Dream-in-Code commented 6 years ago

Iremoved pacaur and only have trizen and got seg fault too

I'll investigate

I-Dream-in-Code commented 6 years ago

figured out the bug.

my sanitize statement is removing everything so it's null and that's why pacaur only worked because there was a special case

fixing now

I-Dream-in-Code commented 6 years ago

fixed

master and AUR package are updated.

Thank you for your patience

I-Dream-in-Code commented 6 years ago

@guicale please verify it's working both no seg fault and the root bug that isn't showing for me

ghost commented 6 years ago

Everything is working now, thank you for your help.

I-Dream-in-Code commented 6 years ago

@guicale I did ps aux | grep trizen with trizen running as the aur helper and it's not showing the process as root it's under my username

I also tested it on a downgraded version of this package and it's no issue.

I think it's not on my end and whoever made that package has a faulty pkgbuild

ghost commented 6 years ago

The thing is that the package I was updating was the arch update notifier itself, and there was a big warning saying trizen was running as root, so I don't know what the problem might have been. image

I-Dream-in-Code commented 6 years ago

I think it's my cleanup function it creates a.so file in the cmake build directory that won't remove unless elevated privileges

Or the fact the plugin backend needs to go into a root owned folder so I need to sudo to add it

But that's cmake and I have no control over it

If it actually fails to update message me

ghost commented 6 years ago

I've already successfully updated another package from the AUR after the update, so everything seems to be working properly now. I'll let you know if I run into any other issues!

I-Dream-in-Code commented 6 years ago

Perfect, sorry I didn't get to it quicker I was at the gym

This is really my only big personal project and it's helping me get jobs so happy to address issues and add features