AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 966714
Accepted
shalom
shalom
Asked: 2019-05-11 05:30:59 +0800 CST2019-05-11 05:30:59 +0800 CST 2019-05-11 05:30:59 +0800 CST

在 redhat 7.2 上自动挂载 nfs 不起作用

  • 772

我的 linux 客户端(redhat 7.2)上有以下 nfd 共享文件夹

master1:/nfs             41932800 6601728  35331072  16% /nfsshare

我们决定使用服务 auto fs 以防此共享文件夹被卸载

我们创建了以下服务(根据链接 - https://michlstechblog.info/blog/systemd-automount-nfs-export/)

ls -ltr  auto-mnt.service
-rw-r--r-- 1 root root 212 May 10 12:38 auto-mnt.service

会议

 more  auto-mnt.service
[Unit]
  Description=nfs mount script
  Requires=network-online.target
  After=network-online.service

[Mount]
  What=master1:/nfs
  Where=/nfsshare
  Options=
  Type=nfs

[Install]
  WantedBy=multi-user.target

和

systemctl daemon-reload

和

 systemctl start auto-mnt.service
Failed to start auto-mnt.service: Unit auto-mnt.service failed to load: Invalid argument. See system logs and 'systemctl status auto-mnt.service' for details.
[root@ system]# systemctl status auto-mnt.service
● auto-mnt.service - nfs mount script
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)

我们不明白为什么服务抱怨 -

[/etc/systemd/system/auto-mnt.service:6] Unknown section 'Mount'. Ignoring.
auto-mnt.service lacks both ExecStart= and ExecStop= setting. Refusing.

Unknown section 'Mount'. Ignoring

服务语法有什么问题?

redhat
  • 1 1 个回答
  • 118 Views

1 个回答

  • Voted
  1. Best Answer
    HBruijn
    2019-05-11T07:01:41+08:002019-05-11T07:01:41+08:00

    systemd 中的挂载单元配置文件不是服务,它们需要的文件扩展名为.mountnot.service

    • 2

相关问题

  • 如何设置 Redhat 对 ActiveDirectory 的用户进行身份验证

  • 如何从 RHEL 5 迁移到 CentOS 5?

  • 我应该将 Rails 应用程序部署到哪个目录?

  • 如何移动 MySQL 的数据目录?

  • RHEL 5.3 上可用的 yum 存储库

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve