The startup command doesn't seem to be working
3att3 opened this issue · 5 comments
The pcloudcc works fine when I start it manually ( pcloudcc -u example@myemail.com -d ) but putting it in a .sh file and executed it with crontab ( Added: @reboot /path/to/file.sh ).
How can I start pcloudcc at startup?
Use service or systemctl of your linux distribution
Tutorial
https://www.digitalocean.com/community/tutorials/how-to-configure-a-linux-service-to-start-automatically-after-a-crash-or-reboot-part-1-practical-examples
for use pcloudcc -u example@myemail.com -d whithout typing Password
like this :
echo 'YourPassword' | pcloudcc -u -p -d -m mountPointVolume(/mnt/pcloud)
This line in rc.local for example
accidentally closed it before commending. I will write down my steps and close the thread again.
@ebouda33 Thanks allot for the help!
My steps are as follows:
I created the pcloud.sh file. You can have it wherever you like, mine is in /home/user/startupCommands/
pcloud.sh
#! /bin/sh echo "[PASSWORD]" | pcloudcc -u [MY@EMAIL.COM] -m /home/user/pcloud
the -m /home/user/pcloud is where I wanted to mount my pcloud drive.
Then I created the service file (pcloud.service) in the /etc/systemd/system/
pcloud.service
[Service] User=[MY_USER] Group=[MY_USER] ExecStart=/home/user/startupCommands/pcloud.sh Restart=on-failure [Install] WantedBy=multi-user.target
After that I executed the following commands
sudo systemctl enable pcloud
if you don't want to reboot your system then execute the following command as well
sudo systemctl start pcloud
and that is it!
The pcloud script works like a charm when in the command line...
In Service, it is not working...no message of error.
When I restart the computer, the pCloudDrive does not appear in Nautilus.
pcloud.service
[Service]
User=parallels
Group=parallels
ExecStart=/home/parallels/startup/pcloud.sh
Restart=on-failure
[Install]
WantedBy=multi-user.target
pcloud.sh
#! /bin/sh
echo "password" | pcloudcc -u user@domain -p -d -m /home/parallels/pCloudDrive
nothing happens when I do:
parallels@ubuntu-linux-20-04-desktop:~$ sudo systemctl enable pcloud
parallels@ubuntu-linux-20-04-desktop:~$ sudo systemctl start pcloud
but happens when:
./startup/pcloud.sh
This is the output of sudo systemctl status pcloud
● pcloud.service
Loaded: loaded (/etc/systemd/system/pcloud.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Tue 2023-01-31 14:07:52 -03; 1min 53s ago
Process: 421326 ExecStart=/home/parallels/startup/pcloud.sh (code=exited, status=0/SUCCESS)
Main PID: 421326 (code=exited, status=0/SUCCESS)
Jan 31 14:07:52 ubuntu-linux-20-04-desktop systemd[1]: Started pcloud.service.
Jan 31 14:07:52 ubuntu-linux-20-04-desktop pcloud.sh[421328]: pCloud console client v.2.0.1
Jan 31 14:07:52 ubuntu-linux-20-04-desktop pcloud.sh[421328]: Please, enter password
Jan 31 14:07:52 ubuntu-linux-20-04-desktop pcloud.sh[421328]: Daemon process created. Process id is: 421330
Jan 31 14:07:52 ubuntu-linux-20-04-desktop pcloud.sh[421328]: sudo kill -9 421330
Jan 31 14:07:52 ubuntu-linux-20-04-desktop pcloud.sh[421328]: To stop it.
Jan 31 14:07:52 ubuntu-linux-20-04-desktop systemd[1]: pcloud.service: Succeeded.
but folder is empty and Nautilus does not show the mounted drive
I found the solution...
The pcloud.service must be:
[Service]
User=parallels
Group=parallels
Type=simple
RemainAfterExit=yes
Restart=on-failure
ExecStart=/home/parallels/startup/pcloud.sh
[Install]
WantedBy=multi-user.target
Just add RemainAfterExit=yes
and Type=simple
https://stackoverflow.com/questions/39871883/systemctl-status-shows-inactive-dead