Skip to content
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

Gsync service doesn't start #150

Closed
ST0RMTR00P3R opened this issue Feb 19, 2021 · 2 comments · Fixed by #158
Closed

Gsync service doesn't start #150

ST0RMTR00P3R opened this issue Feb 19, 2021 · 2 comments · Fixed by #158
Labels

Comments

@ST0RMTR00P3R
Copy link

ST0RMTR00P3R commented Feb 19, 2021

When I try to create and start a new gsync service I get following errors:

pi@raspberrypi:~ $ gsync /media/usb-drive/shared -d Share --service sync
=============================================================================================================================================================================================================================================
Service Name: gsync-sync

Folder: /media/usb-drive/shared
Gdrive Folder: Share

# To start or stop the service
bash gsync-sync.service.bash start / stop

# To enable or disable as a boot service:
bash gsync-sync.service.bash enable / disable

# To see logs
bash gsync-sync.service.bash logs

# To remove
bash gsync-sync.service.bash remove
=============================================================================================================================================================================================================================================
pi@raspberrypi:~ $ sudo bash gsync-sync.service.bash start
Job for gsync-sync.service failed because of unavailable resources or another system error.
See "systemctl status gsync-sync.service" and "journalctl -xe" for details.
Error: Cannot start gsync-sync
pi@raspberrypi:~ $ systemctl status gsync-sync.service
● gsync-sync.service - google-drive-upload synchronisation service
   Loaded: loaded (/etc/systemd/system/gsync-sync.service; disabled; vendor preset: enabled)
   Active: failed (Result: resources)

Feb 19 10:45:23 raspberrypi systemd[1]: gsync-sync.service: Failed with result 'resources'.
Feb 19 10:45:23 raspberrypi systemd[1]: Failed to start google-drive-upload synchronisation service.
Feb 19 10:48:06 raspberrypi systemd[1]: gsync-sync.service: Failed to load environment files: No such file or directory
Feb 19 10:48:06 raspberrypi systemd[1]: gsync-sync.service: Failed to run 'start' task: No such file or directory
Feb 19 10:48:06 raspberrypi systemd[1]: gsync-sync.service: Failed with result 'resources'.
Feb 19 10:48:06 raspberrypi systemd[1]: Failed to start google-drive-upload synchronisation service.
Feb 19 11:12:41 raspberrypi systemd[1]: gsync-sync.service: Failed to load environment files: No such file or directory
Feb 19 11:12:41 raspberrypi systemd[1]: gsync-sync.service: Failed to run 'start' task: No such file or directory
Feb 19 11:12:41 raspberrypi systemd[1]: gsync-sync.service: Failed with result 'resources'.
Feb 19 11:12:41 raspberrypi systemd[1]: Failed to start google-drive-upload synchronisation service.
pi@raspberrypi:~ $ journalctl -xe
-- The job identifier is 746 and the job result is failed.
Feb 19 10:48:07 raspberrypi sudo[930]: pam_unix(sudo:session): session closed for user root
Feb 19 10:48:07 raspberrypi sudo[910]: pam_unix(sudo:session): session closed for user root
Feb 19 11:12:40 raspberrypi sudo[1203]:       pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/bash gsync-sync.service.bash start
Feb 19 11:12:40 raspberrypi sudo[1203]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Feb 19 11:12:40 raspberrypi sudo[1205]:     root : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/printf %s\n # Systemd service file - start
                                        [Unit]
                                        Description=google-drive-upload synchronisation service
                                        After=network.target

                                        [Service]
                                        Type=simple
                                        User=pi
                                        Restart=on-abort
                                        RestartSec=3
                                        EnvironmentFile=/home/pi/.google-drive-upload/google-drive-upload.info
                                        ExecStart=/usr/bin/env bash "${INSTALL_PATH}/${SYNC_COMMAND_NAME}" --foreground --command "${INSTALL_PATH}/${COMMAND_NAME}" --sync-detail-dir "/tmp/sync" "/media/usb-drive/shared"  -a " -C "Share"

                                        # Security
                                        PrivateTmp=true
                                        ProtectSystem=full
                                        NoNewPrivileges=true
                                        ProtectControlGroups=true
                                        ProtectKernelModules=true
                                        ProtectKernelTunables=true
                                        PrivateDevices=true
                                        RestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK
                                        RestrictNamespaces=true
                                        RestrictRealtime=true
                                        SystemCallArchitectures=native

                                        [Install]
                                        WantedBy=multi-user.target
                                        # Systemd service file - end
Feb 19 11:12:40 raspberrypi sudo[1205]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Feb 19 11:12:40 raspberrypi sudo[1205]: pam_unix(sudo:session): session closed for user root
Feb 19 11:12:40 raspberrypi sudo[1207]:     root : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/systemctl daemon-reload
Feb 19 11:12:40 raspberrypi sudo[1207]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Feb 19 11:12:40 raspberrypi systemd[1]: Reloading.
Feb 19 11:12:40 raspberrypi systemd[1]: /lib/systemd/system/smbd.service:9: PIDFile= references path below legacy directory /var/run/, updating /var/run/samba/smbd.pid → /run/samba/smbd.pid; please update the unit file accordingly.
Feb 19 11:12:40 raspberrypi systemd[1]: /lib/systemd/system/nmbd.service:9: PIDFile= references path below legacy directory /var/run/, updating /var/run/samba/nmbd.pid → /run/samba/nmbd.pid; please update the unit file accordingly.
Feb 19 11:12:41 raspberrypi sudo[1207]: pam_unix(sudo:session): session closed for user root
Feb 19 11:12:41 raspberrypi sudo[1222]:     root : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/systemctl start gsync-sync
Feb 19 11:12:41 raspberrypi sudo[1222]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Feb 19 11:12:41 raspberrypi systemd[1]: gsync-sync.service: Failed to load environment files: No such file or directory
Feb 19 11:12:41 raspberrypi systemd[1]: gsync-sync.service: Failed to run 'start' task: No such file or directory
Feb 19 11:12:41 raspberrypi systemd[1]: gsync-sync.service: Failed with result 'resources'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit gsync-sync.service has entered the 'failed' state with result 'resources'.
Feb 19 11:12:41 raspberrypi systemd[1]: Failed to start google-drive-upload synchronisation service.
-- Subject: A start job for unit gsync-sync.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit gsync-sync.service has finished with a failure.
--
-- The job identifier is 810 and the job result is failed.
Feb 19 11:12:41 raspberrypi sudo[1222]: pam_unix(sudo:session): session closed for user root
Feb 19 11:12:41 raspberrypi sudo[1203]: pam_unix(sudo:session): session closed for user root

After Investigating further I found out that the service is trying to access following Environment files:

EnvironmentFile='/home/pi/.google-drive-upload/google-drive-upload.info'

When I try to see if the file is there i get this:

pi@raspberrypi:~ $ cd /home/pi/.google-drive-upload/
pi@raspberrypi:~/.google-drive-upload $ ls -alh
insgesamt 16K
drwxr-xr-x 4 pi pi 4,0K Feb 19 10:10 .
drwxr-xr-x 5 pi pi 4,0K Feb 19 10:49 ..
drwxr-xr-x 2 pi pi 4,0K Feb 19 08:48 bin
drwxr-xr-x 4 pi pi 4,0K Feb 19 10:12 sync
@niklasfrick
Copy link

Having the same problem. Did you come up with a solution?

@Akianonymus Akianonymus added the bug label May 5, 2021
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue May 10, 2021
…labbots#150

* use full command path in sync loop

* add missing config path file ( CONFIG_INFO )

* create two new functions: _systemd_service_script and _systemd_service_contents

* don't spawn a new shell in systemd service, use full path

README.md: Update for new changes
Akianonymus added a commit to Akianonymus/google-drive-upload that referenced this issue May 10, 2021
…labbots#150

* use full command path in sync loop

* add missing config path file ( CONFIG_INFO )

* create two new functions: _systemd_service_script and _systemd_service_contents

* don't spawn a new shell in systemd service, use full path

README.md: Update for new changes
Akianonymus added a commit that referenced this issue May 10, 2021
…#150

* use full command path in sync loop

* add missing config path file ( CONFIG_INFO )

* create two new functions: _systemd_service_script and _systemd_service_contents

* don't spawn a new shell in systemd service, use full path

README.md: Update for new changes
@Akianonymus
Copy link
Collaborator

It has been fixed: 6e6d02f

Update gupload to get the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants