Systemd 教程

来源:互联网 发布:电脑硬盘坏了恢复数据 编辑:程序博客网 时间:2024/05/21 00:54

Systemd 入门教程:命令篇

Systemd 入门教程:实战篇

system V与systemd

systemd 的服务管理程序常用命令

如何关闭optee进程

在exports/rfs/lib/systemd/system/optee.service

[Unit]Description=optee services[Service]ExecStartPre=/sbin/modprobe -q optee_armtzExecStart=/usr/bin/tee-supplicantExecStop=/usr/bin/killall -s KILL tee-supplicantExecStopPost=/sbin/modprobe -r optee_armtz[Install]WantedBy=multi-user.target

若要禁止该进程启动,只需要更改ExecStart=/usr/bin/tee-supplicant为ExecStart=
如下:

[Unit]Description=optee services[Service]ExecStartPre=/sbin/modprobe -q optee_armtzExecStart=ExecStop=/usr/bin/killall -s KILL tee-supplicantExecStopPost=/sbin/modprobe -r optee_armtz[Install]WantedBy=multi-user.target
ccflags-y+=-Werrorccflags-y+=-I$(M)/include/arm_commonccflags-y+=-I$(M)/include/linuxccflags-y+=-I$(M)/includeccflags-y+=-I$(M)/coreccflags-y+=-Werrorccflags-y+=-I$(M)/include/linuxccflags-y+=-I$(M)/include

上文为Optee拷贝前的h文件引用路径,移植到drivers目录下时,需要更改h文件路径,所以做如下更改:

ccflags-y+=-Werrorccflags-y+=-Idrivers/optee/include/arm_commonccflags-y+=-Idrivers/optee/include/linuxccflags-y+=-Idrivers/optee/includeccflags-y+=-Idrivers/optee/coreccflags-y+=-Werrorccflags-y+=-Idrivers/optee/include/linuxccflags-y+=-Idrivers/optee/include

ARM开机启动时,调用/exports/rfs/etc/systemd/system/multi-user.target.wants 目录下的server进程

sunyi@mint /exports/rfs/etc/systemd/system/multi-user.target.wants $ lsbusybox-klogd.service  busybox-syslog.service  optee.service  remote-fs.targetsunyi@mint /exports/rfs/etc/systemd/system/multi-user.target.wants $ lltotal 8drwxr-xr-x 2 root root 4096 Jun 23 18:49 ./drwxr-xr-x 7 root root 4096 Jun 23 18:49 ../lrwxrwxrwx 1 root root   41 Jun 23 18:49 busybox-klogd.service -> /lib/systemd/system/busybox-klogd.servicelrwxrwxrwx 1 root root   42 Jun 23 18:49 busybox-syslog.service -> /lib/systemd/system/busybox-syslog.servicelrwxrwxrwx 1 root root   33 Jun 23 18:49 optee.service -> /lib/systemd/system/optee.servicelrwxrwxrwx 1 root root   47 Jun 23 18:45 remote-fs.target -> ../../../../lib/systemd/system/remote-fs.targetsunyi@mint /exports/rfs/lib/systemd/system $ sudo cp optee.service test.servicesunyi@mint /exports/rfs/lib/systemd/system $ sudo ln -s test.service /exports/rfs/etc/systemd/system/multi-user.target.wants (创建软链接)sunyi@mint /exports/rfs/etc/systemd/system/multi-user.target.wants $ lsbusybox-klogd.service  busybox-syslog.service  optee.service  remote-fs.target  test.servicesunyi@mint /exports/rfs/etc/systemd/system/multi-user.target.wants $ lltotal 8drwxr-xr-x 2 root root 4096 Sep  7 15:17 ./drwxr-xr-x 7 root root 4096 Jun 23 18:49 ../lrwxrwxrwx 1 root root   41 Jun 23 18:49 busybox-klogd.service -> /lib/systemd/system/busybox-klogd.servicelrwxrwxrwx 1 root root   42 Jun 23 18:49 busybox-syslog.service -> /lib/systemd/system/busybox-syslog.servicelrwxrwxrwx 1 root root   33 Jun 23 18:49 optee.service -> /lib/systemd/system/optee.servicelrwxrwxrwx 1 root root   47 Jun 23 18:45 remote-fs.target -> ../../../../lib/systemd/system/remote-fs.targetlrwxrwxrwx 1 root root   12 Sep  7 15:17 test.service -> test.service (test.service属于该文件夹下自动创建的文件,因为起动了软连接)

test.service (test.service属于该文件夹下自动创建的文件,因为起动了软连接)

原创粉丝点击