souththzz 2022-11-04 23:05 采纳率: 100%
浏览 23
已结题

ubuntu服务名中的@是什么意思

  • 写回答

2条回答 默认 最新

  • bluetata 云计算领域优质创作者 2022-11-06 12:11
    关注

    请题主无视上面那个人说的,他说的那是linux连接的含义,和题主的问题显然不是一个

    linux系统结构/lib/systemd/system/目录
    该目录自动存放启动文件的配置位置,里面一般包含有XXXXX.service

    首先明确,@符号和前面的字符串,组成了模板,后面的是统一的后缀service

    引用:https://wiki.archlinux.org/title/Systemd

    Note: Some unit names contain an @ sign (e.g. name@string.service): this means that they are instances of a template unit, whose actual file name does not contain the string part (e.g. name@.service). string is called the instance identifier, and is similar to an argument that is passed to the template unit when called with the systemctl command: in the unit file it will substitute the %i specifier. To be more accurate, before trying to instantiate the name@.suffix template unit, systemd will actually look for a unit with the exact name@string.suffix file name, although by convention such a "clash" happens rarely, i.e. most unit files containing an @ sign are meant to be templates. Also, if a template unit is called without an instance identifier, it will generally fail (except with certain systemctl commands, like cat).

    另外一个模板service的举例你可以看一下,更方便理解

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 11月14日
  • 已采纳回答 11月6日
  • 创建了问题 11月4日

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向