probonopd / go-appimage

Go implementation of AppImage tools
MIT License
821 stars 71 forks source link

System-wide install #173

Closed titovmaxim closed 3 years ago

titovmaxim commented 3 years ago

Is there any way to install appimaged only once system-wide and got working for all existing & new users? Will be extremely useful to setup system once and let the users working...

Simple placing in /opt/, adding chmod and running the instance with sudo fails:

sudo /opt/appimaged-*.AppImage 2021/09/13 10:40:51 Desktop notification: Not running on one of the supported Live systems This configuration is currently unsupported but may still work, please give feedback. 2021/09/13 10:40:51 xxxxxxxxxxxxxxxxxxxx ERROR: notification: The name org.freedesktop.Notifications was not provided by any .service files

Running without sudo works as expected but only for current user.

P.S. I'd like @probonopd for a great tool. Thanks!

probonopd commented 3 years ago

Hello @titovmaxim unfortunately this has not been implemented yet.

Maybe your users would best be served by a Linux distribution that comes with AppImage integration support out of the box?

titovmaxim commented 3 years ago

Unfortunately it's not the case. We wish to bring cross-distro solutions at the end. An system-wide install is a must. If you can give an idea how to do it properly we can try to prepare a PR.

probonopd commented 3 years ago

So just that I understand what exactly you are looking for:

This is something else than

One could even think of a combination of the two. Which one are you after?

titovmaxim commented 3 years ago

One note prior to other discussions. appimaged should be installed once (/opt seems to be a good place for that) and work for all existing AND for all newly created users. So once installed on a fresh system it just works.

For our current purposes first method is enough. But generally it seems that the combination of both would be the best.

AppImages placed in system-wide places, like /opt, should be integrated for all users. User-specifics AppImages in $HOME/Downloads, $HOME/Application, etc, should be integrated per user (in $HOME).

I'm not a great specialist of Linux permission system. Is it possible to run appimaged daemon as system (not user) process but process monitor system folders AND all user folders disregarding which user is currently active? Special efforts will be required to work with $HOME files as root to preserve access permissions, but I guess it can be managed.

CalebQ42 commented 3 years ago

A couple of thoughts I have on this

1) If we define a user as someone with a folder in /home, then checking each user's directories should be fairly easy, though technically not "correct". We could possibly parse /etc/passwd, but that would be a mess as we'd have to sift through all the system users. 2) Which folders exactly would we want to watch? though /opt isn't a bad option, but would mean that /opt would get fairly messy if you installed many AppImages. I think a special directory such as /opt/AppImages would at a cleaner and more flexible option. 3) Do we really want to regular behavior be for appimaged installed as root to check all user's folders? Though obviously in your situation it's what you want, I definitely feel that this would be odd as a default behavior.

Especially for number 3, I think the best option would be a /etc/appimaged.conf file with a list of directories to watch and a special WatchUserDirs options. The other option I see would be to install the user systemd file and just have each user manually enable it if they want it.

titovmaxim commented 3 years ago

I see system-wide install relevant for typical home/office machines, not for servers or other specific usages. For such (1) would be a good option even if it's not 100% correct. I'd say one should use such system-wide install when it serves the needs. Otherwise one can live with per-user install like now.

(2) /opt or /opt/AppImages are both acceptable, but I do agree that the second one is a bit cleaner.

(3) If such install is seen as a part of the system I think such check is ok. But separate config with WatchUserDirs is definitelly better.

What is good to have at the end is to have an option for AppImage to work automatically even for new users. Will be great.

titovmaxim commented 3 years ago

It seems that we have solved our personal problem somehow else. Still use .AppImage, but install .desktop file other way around. However I think that one can use /etc/xdg/autostart to force install appimaged fro every user automatically...

probonopd commented 3 years ago

Yes, this is how we think it should be used. Each user running their own instance of appimaged. Glad to hear that it is working for your use case.