Answer the question
In order to leave comments, you need to log in
Console Yandex.Disk - how to autostart the Yandex.Disk daemon on Debian?
There is a server on Debian. There is a well-installed and well-functioning Yandex console disk. However, there is one "BUT" - the daemon does not start after the system reboot, although this feature was set when installing the disk. Manually, with the usual yandex-disk start command, everything works without any problems.
Wrote the simplest daemon startup script, called it yandex_autorun.sh
#!/bin/sh
yandex-disk start
@reboot adept sleep 60 && /home/adept/yandex_autorun.sh
Answer the question
In order to leave comments, you need to log in
Taki managed to solve the loss of little blood. Thanks to @bk0011m for helping me find the answer!
We put the Yandex console disk and make an autorun script.
So - the content of the yandex_autostart.sh script is trivial:
#!/bin/sh
yandex-disk start --dir=/home/adept/srv_storage/YandexDisc --auth=/home/adept/.config/yandex-disk/passwd
chmod +x путь_до_скрипта
(make it executable) Hmm, I don’t understand why it’s so hard to complicate your life with cron if the init.d script is written in 5-20 minutes depending on the skills: either copy-paste one of the available scripts, or follow the guides once and twice .
For example, my /etc/init.d/yadisk
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: yandex_disk
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage Yandex.Disk deamon
### END INIT INFO
# Various constants
user=yadisk
execute() {
su -c "$1" "$user"
}
start() {
echo "Starting Yandex.Disk daemon..."
execute "yandex-disk start"
}
stop() {
echo "Stopping Yandex.Disk daemon..."
execute "yandex-disk stop"
}
status() {
execute "yandex-disk status"
}
# Carry out specific functions when asked to by the system
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
;;
esac
exit 0
update-rc.d yadisk defaults
What if you don't run it as root? Or is it essential?
The fact is that this software, when synchronized, begins to godlessly eat resources and it’s not at all good if this happens under the root.
And about your problem, I suspect that you need to specify the authorization file, which is also a token. Rather, the path to it
Even easier, do this:
# chmod +x /etc/rc.d/rc.local
# echo "/usr/bin/yandex-disk start" >> /etc/rc.d/rc.local
Or it can be even simpler - if the machine has a graphical interface, then in the menu -> system settings there will be something about autorun, where without understanding anything at all, you can add an application with the mouse, specify the command (yandex-disk start) and even a delay for launch after system startup (or rather login under this user).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question