Данная команда и так должна стартовыми скриптами выполняться. Судя по всему вам надо не вызывать mount -a, а разобраться с порядком запуска того, что требует не вовремя доступ к удалённой машине по NFS.
я пробовал, не сработало. service crond restart
963 chmod +x start.sh
970 chmod 777 start.sh
971 vi start.sh
972 ls
973 ./start.sh
974 vi start.sh
975 ./start.sh
976 touch /etc/systemd/system/mount.service
977 chmod 664 /etc/systemd/system/mount.service
978 nano /etc/systemd/system/mount.service
979 vi /etc/systemd/system/mount.service
980 systemctl start mount
981 journalctl -xe
982 systemctl start mount
983 systemctl status mount
Сам сервис в автозапуске, а вот команду нужно набирать вручную
Это тоже возможно из-за нарушения порядка, когда имеющееся mount -a в стартовых скриптах не может подмонтировать и приходится запускать руками: не полностью поднята сеть, не резольвится имя, папка куда монтируется ещё не подмонтирована...
выдает ошибку
Job for mount.service failed because the control process exited with error code. See «systemctl status mount.service» and «journalctl -xe» for details.
[root@artash system]# systemctl status mount.service
● mount.service - Mount Service
Loaded: loaded (/etc/systemd/system/mount.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2017-05-17 17:34:52 +04; 17s ago
Process: 2291 ExecStart=/root/start.sh (code=exited, status=203/EXEC)
Main PID: 2291 (code=exited, status=203/EXEC)
May 17 17:34:52 artash systemd[1]: Starting Mount Service...
May 17 17:34:52 artash systemd[1]: Mount.service: main process exited, code=exited, status=203/EXEC
May 17 17:34:52 artash systemd[1]: Failed to start Mount Service.
May 17 17:34:52 artash systemd[1]: Unit mount.service entered failed state.
May 17 17:34:52 artash systemd[1]: mount.service failed.
Job for mount.service failed because the control process exited with error code. See «systemctl status mount.service» and «journalctl -xe» for details. [root@artash system]# systemctl status mount.service ● mount.service - Mount Service Loaded: loaded (/etc/systemd/system/mount.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2017-05-17 17:34:52 +04; 17s ago Process: 2291 ExecStart=/root/start.sh (code=exited, status=203/EXEC) Main PID: 2291 (code=exited, status=203/EXEC)
May 17 17:34:52 artash systemd[1]: Starting Mount Service... May 17 17:34:52 artash systemd[1]: Mount.service: main process exited, code=exited, status=203/EXEC May 17 17:34:52 artash systemd[1]: Failed to start Mount Service. May 17 17:34:52 artash systemd[1]: Unit mount.service entered failed state. May 17 17:34:52 artash systemd[1]: mount.service failed.
Job for mount.service failed because the control process exited with error code. See «systemctl status mount.service» and «journalctl -xe» for details.
[root@artash system]# systemctl status mount.service
● mount.service - Mount Service Loaded: loaded (/etc/systemd/system/mount.service; enabled;
vendor preset: disabled) Active:
failed (Result: exit-code) since
Wed 2017-05-17 17:34:52 +04; 17s ago Process: 2291 ExecStart=/root/start.sh (code=exited, status=203/EXEC)
Main PID: 2291 (code=exited, status=203/EXEC)
May 17 17:34:52 artash systemd[1]: Starting Mount Service...
May 17 17:34:52 artash systemd[1]: Mount.service: main process exited, code=exited, status=203/EXEC
May 17 17:34:52 artash systemd[1]:
Failed to start Mount Service.
May 17 17:34:52 artash systemd[1]:
Unit mount.service entered failed state. May 17 17:34:52 artash systemd[1]: mount.service failed
[root@artash system]# systemctl status mount
● mount.service - Mount Service Loaded: loaded (/etc/systemd/system/mount.service; enabled;
vendor preset: disabled) Active:
failed (Result: exit-code) since
Wed 2017-05-17 17:34:52 +04; 17s ago Process: 2291 ExecStart=/root/start.sh (code=exited, status=203/EXEC)
Main PID: 2291 (code=exited, status=203/EXEC)
May 17 17:34:52 artash systemd[1]: Starting Mount Service...
May 17 17:34:52 artash systemd[1]: Mount.service: main process exited, code=exited, status=203/EXEC
May 17 17:34:52 artash systemd[1]:
Failed to start Mount Service.
May 17 17:34:52 artash systemd[1]:
Unit mount.service entered failed state. May 17 17:34:52 artash systemd[1]: mount.service failed
NAME
rpc.mountd - NFS mount daemon
SYNOPSIS
/usr/sbin/rpc.mountd [options]
DESCRIPTION
The rpc.mountd daemon implements the server side of the NFS MOUNT protocol,
an NFS side protocol used by NFS version 2 [RFC1094] and NFS version 3
[RFC1813].
An NFS server maintains a table of local physical file systems that are accessible to NFS clients.
Each file system in this table is referred to as an
exported file system, or export, for short.
Each file system in the export table has an access control list.
rpc.mountd uses these access control lists to determine whether an NFS client is permit‐
ted to access a given file system. For details on how to manage your NFS server's export table,
see the exports(5) and exportfs(8) man pages.
Mounting exported NFS File Systems
The NFS MOUNT protocol has several procedures.
The most important of these are MNT (mount an export) and UMNT (unmount an export).
A MNT request has two arguments:
an explicit argument that contains the pathname of the root directory of the export to be mounted,
and an implicit argu‐
ment that is the sender's IP address.
When receiving a MNT request from an NFS client,
rpc.mountd checks both the pathname and the sender's IP address against its export table.
If the sender
is permitted to access the requested export,
rpc.mountd returns an NFS file handle for the export's root directory to the client.
The client can then use
the root file handle and NFS LOOKUP requests to navigate the directory structure of the export.
The rmtab File
The rpc.mountd daemon registers every successful MNT request by adding an entry to the /var/lib/nfs/rmtab file. When receivng a UMNT request from an NFS
client, rpc.mountd simply removes the matching entry from /var/lib/nfs/rmtab, as long as the access control list for that export allows that sender to
access the export.
Clients can discover the list of file systems an NFS server is currently exporting, or the list of other clients that have mounted its exports, by using
the showmount(8) command. showmount(8) uses other procedures in the NFS MOUNT protocol to report information about the server's exported file systems.
Note, however, that there is little to guarantee that the contents of /var/lib/nfs/rmtab are accurate. A client may continue accessing an export even
after invoking UMNT. If the client reboots without sending a UMNT request, stale entries remain for that client in /var/lib/nfs/rmtab.
OPTIONS
-d kind or --debug kind
Turn on debugging. Valid kinds are: all, auth, call, general and parse.
-F or --foreground
Run in foreground (do not daemonize)
Manual page rpc.mountd(8) line 1 (press h for help or q to quit)
а у вас какие предложения, как решить этот вопрос грамотно?
Я вам дал предложение с первого своего комента в этой ветке. Какая ошибка происходит, когда идёт монтирование всего, что в fstab ? Вот эту ошибку и надо устранять, а не руками запускать mount всего.
Вообще говоря, NFS default — это задумывалось для тонких клиентов без дисков. Правда это было давно, но и сейчас может быть поломано на автомате. То есть при таком клиенте надо точно гарантировать, что сеть поднята до монтирования всего из fstab. Для вас по быстрому подправить - поменять default на noauto, а в вашем сервисе дать mount -a -t nfs - это будет правильно, если NFSшара одна и только этот сервис от неё зависит.