-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add systemd user service #3510
base: master
Are you sure you want to change the base?
Add systemd user service #3510
Conversation
I just wanted to throw in that this might not play nice with the autostart file that we provide. If the user disables autostart in the application, and has the systemd file installed, the settings from the gui get not respected anymore. That may confuse users. EDIT: Btw you can use |
I agree, the UI is completely unaware of the systemd unit, but it is also true that having the unit installed does not cause the service to start, so unless the user manually runs Syncing the UI and the systemd unit would be nice though |
I just noticed that running Nextcloud through systemd causes some minor issues; the client does not respect GTK settings like icon theme, font, etc (see screenshot). Nothing that would cause serious problems, but I would prefer to first fix that issues and then let you merge this. Sorry for not noticing earlier :) (this also says a lot about the severity of the issue) |
This looks like a Qt issue, as running GTK apps through systemd does not cause any issue, while apps like qbittorrent suffer from the same problem. If anyone has any suggestion it would be much appreciated :) |
I guess you will want to modify |
That's the same thing I thought, but it seems that it doesn't solve the issue. Even manually restarting the service after the system is fully booted does nothing. |
I will have another look soon unless somebody is faster than me |
@Tachi107 I am really sorry for the lack of followup from me on this one |
Signed-off-by: Andrea Pappacoda <[email protected]>
7e2afda
to
394c89d
Compare
Don't worry :) |
AppImage file: Nextcloud-PR-3510-394c89d50ed0abd4955957cc69bb976fca037819-x86_64.AppImage |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3510 +/- ##
==========================================
- Coverage 56.42% 56.42% -0.01%
==========================================
Files 138 138
Lines 17071 17071
==========================================
- Hits 9633 9632 -1
- Misses 7438 7439 +1 |
Wants=network-online.target | ||
|
||
[Service] | ||
ExecStart=@bindir@/nextcloud --background |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
executable name is defined as a variable in cmake files
please replace this by this variable APPLICATION_EXECUTABLE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my other comments
for the context
when developing the Nextcloud client, I run in parallel the latest official AppImage binary
so to be able to run my self built desktop client, I make changes to NEXTCLOUD.cmake
to not conflict with the already running client
option(INSTALL_SYSTEMD "Install systemd user service" ON) | ||
if(INSTALL_SYSTEMD) | ||
set(bindir ${CMAKE_INSTALL_FULL_BINDIR}) | ||
configure_file(systemd/nextcloud-desktop.service.in ${CMAKE_CURRENT_BINARY_DIR}/nextcloud-desktop.service) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of nextcloud-desktop
please use this cmake variable LINUX_APPLICATION_ID
that is already in use with the .desktop file generation (https://github.com/nextcloud/desktop/blob/master/src/gui/CMakeLists.txt#L732)
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
[Unit] | ||
Description=Nextcloud desktop user service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please replace Nextcloud
by this variable from cmake APPLICATION_NAME
@Tachi107 gentle ping |
Oh yeah, sure, don't be afraid to ping. I most likely forgot about this. I'll take a look later today :)
Il 13 febbraio 2025 09:17:53 CET, Matthieu Gallien ***@***.***> ha scritto:
…mgallien left a comment (nextcloud/desktop#3510)
@Tachi107 gentle ping
could you have a look at the requested changes ?
without a reply from you I would take over the PR and create a branch cherry-picking your commit
in any case, thanks for the contribution
|
Just as a hint… maybe you might want to have a look at how Syncthing is dealing this!?
|
Closes #728
I didn't know where to put the systemd unit, so I created a
systemd/
directory. Let me know if there is a more appropriate place :)Edit: forgot to mention that I've obviously tested this, and (on my Debian 11 pc) everything works as expected