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
    • 最新
    • 标签
主页 / user-337104

peter cooke's questions

Martin Hope
peter cooke
Asked: 2021-12-13 19:14:41 +0800 CST

windows bat需要判断msql odbc库的版本

  • 0

嗨,我需要在标准 Windows 10 实例上构建一个可能的电源外壳。我需要一种编程方式来使用https://packages.microsoft.com/rhel/8/prod/
上最新 msodbcsql 库的版本字符串设置环境变量

当前的最新版本是https://packages.microsoft.com/rhel/8/prod/msodbcsql17-17.8.1.2-1.x86_64.rpm但这每隔几个月就会改变一次。

我想到了类似下面的伪代码

set msodbcver=Invoke-WebRequest -Uri  https://packages.microsoft.com/rhel/8/prod/ | grep msodbcsq | sort 

但我的 Windows 系统在 cmd.exe 或 powershell 中都找不到 Invoke-WebRequest。是的,我是一个试图找出等效的 MS 脚本的 unix 人

windows powershell windows-batch
  • 1 个回答
  • 25 Views
Martin Hope
peter cooke
Asked: 2020-04-08 20:48:47 +0800 CST

systemd 服务文件总是启动和停止

  • 1

已经为 botpress 创建了一个新的 systemd 服务如果我这样做了

systemctl 启动 botpress.service

它启动所有 botpress 的东西,然后立即运行 ExecStop 的东西。如果我删除 ExecStop=....... Systemctl 启动正常

被调用的脚本工作得很好。

cat /etc/systemd/system/botpress.service 
[Unit]
Description=botpess
After=docker.service

[Service]
Type=simple

TimeoutStartSec=5s
ExecStartPre=/bin/bash -c 'echo ">>>>>>>>>>> pre-starting botpress <<<<<<<<<<<<<<<"'
ExecStart=/etc/systemd/system/botpress.initd start
ExecStartPost=/bin/bash -c 'echo ">>>>>>>>>>> post-starting botpress <<<<<<<<<<<<<<<"'


ExecStop=/etc/systemd/system/botpress.initd stop
ExecStopPost=/bin/bash -c 'echo ">>>>>>>>>>> post-stopping botpress <<<<<<<<<<<<<<<"'

[Install]
WantedBy=multi-user.target

我可以将 botpress.initd 脚本放入 /etc/init.d 并让 systemctl 停止和启动,但不会在重新启动时重新启动。我想做的只是调用一个简单的脚本,它可以按需启动和停止并在重新启动时启用

cat botpress.initd 
#! /bin/bash -x 
### BEGIN INIT INFO
# Provides:          my-service-name
# Required-Start:    $all
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: your description here
### END INIT INFO

BOTPRESS_COMPOSE_HOME="/home/pcooke/tmp/botpress/examples/docker-compose/"
COMPOSE_YAML="docker-compose-pro-nginx.yaml"
# Default-Start: 2 3 4 5
#OPTIONS="--verbose"

start() {
  echo "starting botpress"
  /usr/local/bin/docker-compose ${OPTIONS} -f ${COMPOSE_YAML} up -d  --build
}

stop() {
  echo "stopping botpress"
  /usr/local/bin/docker-compose ${OPTIONS} -f ${COMPOSE_YAML} down
}


cd ${BOTPRESS_COMPOSE_HOME}

case "$1" in
        start)
            start
            ;;

        stop)
            stop
            ;;
        restart)
            stop
            start
            ;;
        *)
            echo $"Usage: $0 {start|stop|restart}"
            exit 1

esac
root@pcooke-XPS-13-9370:/etc/systemd/system# journalctl -xe
Apr 07 21:20:50 pcooke-XPS-13-9370 botpress.initd[4029]: [263B blob data]
Apr 07 21:20:50 pcooke-XPS-13-9370 botpress.initd[4029]: Removing botpress-server ...
Apr 07 21:20:50 pcooke-XPS-13-9370 botpress.initd[4029]: Removing redis           ...
Apr 07 21:20:50 pcooke-XPS-13-9370 botpress.initd[4029]: Removing botpress-lang   ...
Apr 07 21:20:50 pcooke-XPS-13-9370 botpress.initd[4029]: Removing postgres        ...
Apr 07 21:20:50 pcooke-XPS-13-9370 botpress.initd[4029]: [274B blob data]
Apr 07 21:20:50 pcooke-XPS-13-9370 avahi-daemon[817]: Interface br-e6bd415385a8.IPv6 no longer relevant for mDNS.
Apr 07 21:20:50 pcooke-XPS-13-9370 avahi-daemon[817]: Leaving mDNS multicast group on interface br-e6bd415385a8.IPv6 with address fe80::42:9fff:fe45:b457.
Apr 07 21:20:50 pcooke-XPS-13-9370 avahi-daemon[817]: Interface br-e6bd415385a8.IPv4 no longer relevant for mDNS.
Apr 07 21:20:50 pcooke-XPS-13-9370 avahi-daemon[817]: Leaving mDNS multicast group on interface br-e6bd415385a8.IPv4 with address 172.27.0.1.
Apr 07 21:20:50 pcooke-XPS-13-9370 avahi-daemon[817]: Withdrawing address record for fe80::42:9fff:fe45:b457 on br-e6bd415385a8.
Apr 07 21:20:50 pcooke-XPS-13-9370 avahi-daemon[817]: Withdrawing address record for 172.27.0.1 on br-e6bd415385a8.
Apr 07 21:20:50 pcooke-XPS-13-9370 NetworkManager[849]: <info>  [1586319650.5374] device (br-e6bd415385a8): state change: activated -> unmanaged (reason 'unmanaged', sys-iface-state: 'removed')
Apr 07 21:20:50 pcooke-XPS-13-9370 dbus-daemon[824]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.10' (u
Apr 07 21:20:50 pcooke-XPS-13-9370 gnome-shell[2943]: Removing a network device that was not added
Apr 07 21:20:50 pcooke-XPS-13-9370 systemd[1]: Starting Network Manager Script Dispatcher Service...
-- Subject: Unit NetworkManager-dispatcher.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit NetworkManager-dispatcher.service has begun starting up.
Apr 07 21:20:50 pcooke-XPS-13-9370 gnome-shell[1161]: Removing a network device that was not added
Apr 07 21:20:50 pcooke-XPS-13-9370 dbus-daemon[824]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Apr 07 21:20:50 pcooke-XPS-13-9370 systemd[1]: Started Network Manager Script Dispatcher Service.
-- Subject: Unit NetworkManager-dispatcher.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit NetworkManager-dispatcher.service has finished starting up.
-- 
-- The start-up result is RESULT.
Apr 07 21:20:50 pcooke-XPS-13-9370 nm-dispatcher[4557]: req:1 'down' [br-e6bd415385a8]: new request (2 scripts)
Apr 07 21:20:50 pcooke-XPS-13-9370 nm-dispatcher[4557]: req:1 'down' [br-e6bd415385a8]: start running ordered scripts...
Apr 07 21:20:50 pcooke-XPS-13-9370 NetworkManager[849]: <info>  [1586319650.5626] devices removed (path: /sys/devices/virtual/net/br-e6bd415385a8, iface: br-e6bd415385a8)
Apr 07 21:20:50 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 07 21:20:50 pcooke-XPS-13-9370 bash[4641]: >>>>>>>>>>> post-stopping botpress <<<<<<<<<<<<<<<
Apr 07 21:20:51 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 07 21:20:51 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 07 21:20:51 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 07 21:20:51 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 07 21:20:51 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 07 21:20:51 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 07 21:20:53 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced fe
/////

将类型更改为 onshot 并重新启动后

root@pcoo/ke-XPS-13-9370:/etc/systemd/system# systemctl start botpress
Job for botpress.service failed because a timeout was exceeded.
See "systemctl status botpress.service" and "journalctl -xe" for details.
 systemctl status botpress
● botpress.service - botpess
   Loaded: loaded (/etc/systemd/system/botpress.service; disabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Wed 2020-04-08 19:14:33 PDT; 5min ago
  Process: 11561 ExecStopPost=/bin/bash -c echo ">>>>>>>>>>> post-stopping botpress <<<<<<<<<<<<<<<" (code=exited, status=0/SUCCESS)
  Process: 11026 ExecStart=/etc/systemd/system/botpress.initd start (code=killed, signal=TERM)
  Process: 11025 ExecStartPre=/bin/bash -c echo ">>>>>>>>>>> pre-starting botpress <<<<<<<<<<<<<<<" (code=exited, status=0/SUCCESS)
 Main PID: 11026 (code=killed, signal=TERM)

Apr 08 19:14:30 pcooke-XPS-13-9370 botpress.initd[11026]: Successfully tagged docker-compose_nginx:latest
Apr 08 19:14:30 pcooke-XPS-13-9370 botpress.initd[11026]: Creating postgres ...
Apr 08 19:14:30 pcooke-XPS-13-9370 botpress.initd[11026]: Creating redis    ...
Apr 08 19:14:30 pcooke-XPS-13-9370 botpress.initd[11026]: Creating botpress-lang ...
Apr 08 19:14:33 pcooke-XPS-13-9370 systemd[1]: botpress.service: Start operation timed out. Terminating.
Apr 08 19:14:33 pcooke-XPS-13-9370 systemd[1]: botpress.service: Main process exited, code=killed, status=15/TERM
Apr 08 19:14:33 pcooke-XPS-13-9370 botpress.initd[11026]: [90B blob data]
Apr 08 19:14:33 pcooke-XPS-13-9370 bash[11561]: >>>>>>>>>>> post-stopping botpress <<<<<<<<<<<<<<<
Apr 08 19:14:33 pcooke-XPS-13-9370 systemd[1]: botpress.service: Failed with result 'timeout'.
Apr 08 19:14:33 pcooke-XPS-13-9370 systemd[1]: Failed to start botpess.

新期刊ctl -xe

journalctl -xe
Apr 08 19:14:32 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 08 19:14:32 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 08 19:14:32 pcooke-XPS-13-9370 kernel: eth0: renamed from vethfbd729e
Apr 08 19:14:32 pcooke-XPS-13-9370 NetworkManager[849]: <info>  [1586398472.3620] devices removed (path: /sys/devices/virtual/net/vethfbd729e, iface: vethfbd729e)
Apr 08 19:14:32 pcooke-XPS-13-9370 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): vethaec5c13: link becomes ready
Apr 08 19:14:32 pcooke-XPS-13-9370 kernel: br-83455e030a4d: port 1(vethaec5c13) entered blocking state
Apr 08 19:14:32 pcooke-XPS-13-9370 kernel: br-83455e030a4d: port 1(vethaec5c13) entered forwarding state
Apr 08 19:14:32 pcooke-XPS-13-9370 NetworkManager[849]: <info>  [1586398472.3647] device (vethaec5c13): carrier: link connected
Apr 08 19:14:32 pcooke-XPS-13-9370 gnome-shell[2943]: Removing a network device that was not added
Apr 08 19:14:32 pcooke-XPS-13-9370 gnome-shell[1161]: Removing a network device that was not added
Apr 08 19:14:32 pcooke-XPS-13-9370 avahi-daemon[817]: Joining mDNS multicast group on interface br-83455e030a4d.IPv6 with address fe80::42:76ff:fe65:828.
Apr 08 19:14:32 pcooke-XPS-13-9370 avahi-daemon[817]: New relevant interface br-83455e030a4d.IPv6 for mDNS.
Apr 08 19:14:32 pcooke-XPS-13-9370 avahi-daemon[817]: Registering new address record for fe80::42:76ff:fe65:828 on br-83455e030a4d.*.
Apr 08 19:14:33 pcooke-XPS-13-9370 avahi-daemon[817]: Joining mDNS multicast group on interface veth9ba683a.IPv6 with address fe80::877:c1ff:fe8d:4ccf.
Apr 08 19:14:33 pcooke-XPS-13-9370 avahi-daemon[817]: New relevant interface veth9ba683a.IPv6 for mDNS.
Apr 08 19:14:33 pcooke-XPS-13-9370 avahi-daemon[817]: Registering new address record for fe80::877:c1ff:fe8d:4ccf on veth9ba683a.*.
Apr 08 19:14:33 pcooke-XPS-13-9370 kernel: eth0: renamed from vethbde55a8
Apr 08 19:14:33 pcooke-XPS-13-9370 NetworkManager[849]: <info>  [1586398473.3297] devices removed (path: /sys/devices/virtual/net/vethbde55a8, iface: vethbde55a8)
Apr 08 19:14:33 pcooke-XPS-13-9370 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): veth1583c41: link becomes ready
Apr 08 19:14:33 pcooke-XPS-13-9370 kernel: br-83455e030a4d: port 3(veth1583c41) entered blocking state
Apr 08 19:14:33 pcooke-XPS-13-9370 kernel: br-83455e030a4d: port 3(veth1583c41) entered forwarding state
Apr 08 19:14:33 pcooke-XPS-13-9370 NetworkManager[849]: <info>  [1586398473.3324] device (veth1583c41): carrier: link connected
Apr 08 19:14:33 pcooke-XPS-13-9370 gnome-shell[1161]: Removing a network device that was not added
Apr 08 19:14:33 pcooke-XPS-13-9370 gnome-shell[2943]: Removing a network device that was not added
Apr 08 19:14:33 pcooke-XPS-13-9370 systemd[1]: botpress.service: Start operation timed out. Terminating.
Apr 08 19:14:33 pcooke-XPS-13-9370 systemd[1]: botpress.service: Main process exited, code=killed, status=15/TERM
Apr 08 19:14:33 pcooke-XPS-13-9370 botpress.initd[11026]: [90B blob data]
Apr 08 19:14:33 pcooke-XPS-13-9370 bash[11561]: >>>>>>>>>>> post-stopping botpress <<<<<<<<<<<<<<<
Apr 08 19:14:33 pcooke-XPS-13-9370 systemd[1]: botpress.service: Failed with result 'timeout'.
Apr 08 19:14:33 pcooke-XPS-13-9370 systemd[1]: Failed to start botpess.
-- Subject: Unit botpress.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit botpress.service has failed.
-- 
-- The result is RESULT.
Apr 08 19:14:34 pcooke-XPS-13-9370 avahi-daemon[817]: Joining mDNS multicast group on interface vethaec5c13.IPv6 with address fe80::60f4:dfff:fe0a:ff72.
Apr 08 19:14:34 pcooke-XPS-13-9370 avahi-daemon[817]: New relevant interface vethaec5c13.IPv6 for mDNS.
Apr 08 19:14:34 pcooke-XPS-13-9370 avahi-daemon[817]: Registering new address record for fe80::60f4:dfff:fe0a:ff72 on vethaec5c13.*.
Apr 08 19:14:34 pcooke-XPS-13-9370 avahi-daemon[817]: Joining mDNS multicast group on interface veth1583c41.IPv6 with address fe80::d4ce:bdff:fedc:6e74.
Apr 08 19:14:34 pcooke-XPS-13-9370 avahi-daemon[817]: New relevant interface veth1583c41.IPv6 for mDNS.
Apr 08 19:14:34 pcooke-XPS-13-9370 avahi-daemon[817]: Registering new address record for fe80::d4ce:bdff:fedc:6e74 on veth1583c41.*.
Apr 08 19:14:37 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 08 19:14:37 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 08 19:14:37 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 08 19:14:37 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 08 19:14:37 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 08 19:14:37 pcooke-XPS-13-9370 systemd-resolved[641]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 08 19:17:01 pcooke-XPS-13-9370 CRON[11653]: pam_unix(cron:session): session opened for user root by (uid=0)
Apr 08 19:17:01 pcooke-XPS-13-9370 CRON[11654]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Apr 08 19:17:01 pcooke-XPS-13-9370 CRON[11653]: pam_unix(cron:session): session closed for user root

有趣的是:在启用 botpress 并重新启动之后,除了 nginx 容器之外的所有内容都启动了

 systemctl status botpress
● botpress.service - botpess
   Loaded: loaded (/etc/systemd/system/botpress.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Wed 2020-04-08 19:27:24 PDT; 2min 52s ago
  Process: 2490 ExecStopPost=/bin/bash -c echo ">>>>>>>>>>> post-stopping botpress <<<<<<<<<<<<<<<" (code=exited, status=0/SUCCESS)
  Process: 1677 ExecStart=/etc/systemd/system/botpress.initd start (code=killed, signal=TERM)
  Process: 1676 ExecStartPre=/bin/bash -c echo ">>>>>>>>>>> pre-starting botpress <<<<<<<<<<<<<<<" (code=exited, status=0/SUCCESS)
 Main PID: 1677 (code=killed, signal=TERM)

Apr 08 19:27:20 pcooke-XPS-13-9370 botpress.initd[1677]: Successfully tagged docker-compose_nginx:latest
Apr 08 19:27:20 pcooke-XPS-13-9370 botpress.initd[1677]: Starting botpress-lang ...
Apr 08 19:27:20 pcooke-XPS-13-9370 botpress.initd[1677]: Starting redis         ...
Apr 08 19:27:20 pcooke-XPS-13-9370 botpress.initd[1677]: Starting postgres      ...
Apr 08 19:27:23 pcooke-XPS-13-9370 botpress.initd[1677]: [163B blob data]
Apr 08 19:27:24 pcooke-XPS-13-9370 systemd[1]: botpress.service: Start operation timed out. Terminating.
Apr 08 19:27:24 pcooke-XPS-13-9370 systemd[1]: botpress.service: Main process exited, code=killed, status=15/TERM
Apr 08 19:27:24 pcooke-XPS-13-9370 bash[2490]: >>>>>>>>>>> post-stopping botpress <<<<<<<<<<<<<<<
Apr 08 19:27:24 pcooke-XPS-13-9370 systemd[1]: botpress.service: Failed with result 'timeout'.
Apr 08 19:27:24 pcooke-XPS-13-9370 systemd[1]: Failed to start botpess.

当我只有 ExecStart 时,我没有提到标记 NGINX。这是我的compse文件。

cat docker-compose-pro-nginx.yaml 
version: '3.7'

services:
  botpress:
    build:
      context: ./botpress
      dockerfile: Dockerfile
    image: botpress-server
    container_name: botpress-server
    command: bash -c "export AUTO_MIGRATE=true; ./bp --auto-update"
    expose:
      - 3000
    environment:
      - DATABASE_URL=postgres://postgres:secretpw@postgres:5435/botpress_db
      - REDIS_URL=redis://redis:6379?password=redisPassword
      - BP_MODULE_NLU_DUCKLINGURL=http://botpress_lang:8000
      - BP_MODULE_NLU_LANGUAGESOURCES=[{"endpoint":"http://botpress_lang:3100"}]
      - EXTERNAL_URL=https://botpressdev.sf.frb.org
      - CLUSTER_ENABLED=true
      - PRO_ENABLED=true
      - BP_PRODUCTION=true
      - BPFS_STORAGE=database
      - BP_LICENSE_KEY=123456789
    depends_on:
      - botpress_lang
      - postgres
      - redis
    volumes:
      - /opt/botpress-data/botpress:/botpress/data

  botpress_lang:
    build:
      context: ./botpress
      dockerfile: Dockerfile
    image: botpress-lang
    container_name: botpress-lang
    command: bash -c "./duckling -p 8000 & ./bp lang --langDir /botpress/lang --port 3100"
    expose:
      - 3100
      - 8000
    volumes:
      - /opt/botpress-data/language:/botpress/lang

  postgres:
    image: postgres:11.2-alpine
    expose:
      - 5435
    container_name: postgres
    environment:
      PGPORT: 5435
      POSTGRES_DB: botpress_db
      POSTGRES_PASSWORD: secretpw
      POSTGRES_USER: postgres
    volumes:
      - /opt/botpress-data/postgres/data:/var/lib/postgresql/data

  redis:
    image: redis:5.0.5-alpine
    expose:
      - 6379
    container_name: redis
    command: redis-server --requirepass redisPassword
    volumes:
      - redisdata:/data

  nginx:
    container_name: nginx
    build: ./nginx
    ports:
      - 80:80
    command: nginx -g 'daemon off';
    depends_on:
      - botpress

volumes:
  redisdata:
systemd
  • 2 个回答
  • 1012 Views
Martin Hope
peter cooke
Asked: 2020-04-05 05:02:30 +0800 CST

在启动时启动软件的正确方法?

  • -1

我太落伍了。自“#_something”以来,我没有设计系统启动/停止启动脚本。

我有一个基于 docker compose 的应用程序,我需要在启动时启动并在关机前停止。

现在认为正确的方法是:sysctl、systemctl、服务或其他。

因为这取决于 docker 运行,这取决于其他事情。我在想 systemctl

当前在引导时启动软件的正确方法是什么?你能推荐好的文档和例子吗?

我的实际使用是 RHEL 7.6+ 和 Unbuntu 18.4+,但我想支持最广泛的 linux/unix 平台基础

linux
  • 1 个回答
  • 53 Views
Martin Hope
peter cooke
Asked: 2019-09-28 07:50:06 +0800 CST

SunOS 的任何透明文件系统

  • 7

早在 Solaris 之前,SunOS 就有一个很酷的特性,称为透明文件系统。基本概念允许磁盘文件系统像投影仪上的透明胶片一样堆叠。并允许演示者在顶部透明度上绘制。

透明文件系统的现代等价物是什么?我想要/需要堆叠多个驱动器文件系统。

filesystems
  • 4 个回答
  • 202 Views
Martin Hope
peter cooke
Asked: 2016-02-12 11:55:03 +0800 CST

Knife ssh 节点名通配符匹配

  • 1

我有一个厨师环境“开发”,我们正在将我们的持续集成构建环境从詹金斯切换到竹子。所以我们有一堆节点名称“jenkins_slave_??” 和“bamboo_slave_??

我想在开发环境中的所有 jenkins_slave 系统上执行 yum update -y 。为了测试那把刀只击中我想要的服务器,以下将在开发环境中的所有主机上执行命令。

knife ssh '*:dev' 'hostname; cat /etc/redhat-release '  -a cloud.public_ipv4 -x ec2-user -i ~/.ssh/dev.pem

以下将在特定主机上执行我的命令。

knife ssh '*:jenkins_slave_01' 'hostname; cat /etc/redhat-release '  -a cloud.public_ipv4 -x ec2-user -i ~/.ssh/dev.pem

我无法得到

knife ssh '*:jenkins_slave_*' 'hostname; cat /etc/redhat-release '  -a cloud.public_ipv4 -x ec2-user -i ~/.ssh/dev.pem

或者

knife ssh 'jenkins_slave_*:*' 'hostname; cat /etc/redhat-release '  -a cloud.public_ipv4 -x ec2-user -i ~/.ssh/dev.pem

去工作。如何让刀向具有相似节点名称的所有主机发出 ssh 命令?

chef
  • 1 个回答
  • 526 Views

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