标签:指令 vendor disable bsp ice conflict 根据 time 拷贝
[root@lianhua lib]$ cat /proc/37220/status | egrep "Uid|Gid" Uid: 1004 1004 1004 1004 Gid: 1007 1007 1007 1007
[robot@lianhua ~]$ ll /bin/passwd -rwsr-xr-x. 1 root root 27832 Jan 30 2014 /bin/passwd [robot@lianhua ~]$ passwd Changing password for user robot. Changing password for robot. (current) UNIX password: [root@lianhua ~]$ ps -lA | grep passwd 4 S 0 38063 37943 0 80 0 - 47201 wait_w pts/15 00:00:00 passwd [root@lianhua ~]$ cat /proc/38063/status | egrep "Uid|Gid" Uid: 1004 0 0 0 Gid: 1007 1007 1007 1007
[root@lianhua lib]$ cat copy.sh #!/bin/bash sleep 10 cp /home_local/robot/systemd/tmp.log /home_local/robot/systemd/lib/ chown test /home_local/robot/systemd/lib/tmp.log rm -rf /home_local/robot/systemd/lib/tmp.log sleep 10
[root@lianhua lib]$ systemctl cat copy.service # /usr/lib/systemd/system/copy.service [Unit] Description=a test copy demo for process conflict handle Documentation=man:systemd.unit(8) [Service] Type=simple ExecStart=/bin/bash /home_local/robot/systemd/lib/copy.sh Restart=on-failure # /usr/lib/systemd/system/copy.service.d/app.conf [Service] User= User=robot
[root@lianhua ~]$ systemctl status copy.service ● copy.service - a test copy demo for process conflict handle Loaded: loaded (/usr/lib/systemd/system/copy.service; static; vendor preset: disabled) Drop-In: /usr/lib/systemd/system/copy.service.d └─app.conf Active: activating (start) since Sun 2020-05-10 16:24:40 CST; 7s ago Docs: man:systemd.unit(8) Control: 40081 (bash) Memory: 432.0K CGroup: /system.slice/copy.service ├─40081 /bin/bash /home_local/robot/systemd/lib/copy.sh └─40083 sleep 10 May 10 16:33:52 lianhua systemd[1]: Starting a test copy demo for process conflict handle... May 10 16:34:02 lianhua bash[40767]: chown: changing ownership of ‘/home_local/robot/systemd/lib/tmp.log’: Opera…ermitted [root@lianhua ~]$ cat /proc/40081/status| egrep "Uid|Gid" Uid: 1004 1004 1004 1004 Gid: 1007 1007 1007 1007 [root@lianhua ~]$ ps -lAf | grep copy.service 4 S root 40075 32280 0 80 0 - 33707 poll_s 16:24 pts/15 00:00:00 systemctl restart copy.service 0 S root 40130 32507 0 80 0 - 28179 pipe_w 16:25 pts/16 00:00:00 grep --color=auto copy.service [root@lianhua ~]$ ps -lAf | grep 40081 4 S robot 40081 1 0 80 0 - 28296 do_wai 16:24 ? 00:00:00 /bin/bash /home_local/robot/systemd/lib/copy.sh 0 S robot 40098 40081 0 80 0 - 26990 hrtime 16:24 ? 00:00:00 sleep 10 [root@lianhua lib]$ ll total 4 -rw-r--r-- 1 root root 197 May 10 16:24 copy.sh -rw-r--r-- 1 robot robot 0 May 10 16:26 tmp.log [root@lianhua lib]$ cd .. [root@lianhua systemd]$ ll total 0 drwxrwxrwx 2 root root 6 May 7 11:17 bin drwxrwxrwx 2 root root 36 May 10 16:24 lib -rw-r--r-- 1 root root 0 May 7 11:17 tmp.log
[root@lianhua ~]$ which chown /usr/bin/chown [root@lianhua ~]$ ll /usr/bin/chown -rwxr-xr-x. 1 root root 62904 Dec 4 2017 /usr/bin/chown
[root@lianhua ~]$ chmod 4755 /usr/bin/chown [root@lianhua ~]$ ll /usr/bin/chown -rwsr-xr-x. 1 root root 62904 Dec 4 2017 /usr/bin/chown
[root@lianhua ~]$ su - robot [robot@lianhua ~]$ ll /home_local/robot/systemd/lib/tmp.log -rw-r--r-- 1 robot robot 0 May 10 17:14 /home_local/robot/systemd/lib/tmp.log [robot@lianhua ~]$ chown test /home_local/robot/systemd/lib/tmp.log [robot@lianhua ~]$ ll /home_local/robot/systemd/lib/tmp.log -rw-r--r-- 1 test robot 0 May 10 17:14 /home_local/robot/systemd/lib/tmp.log [root@lianhua lib]$ systemctl status copy.service ● copy.service - a test copy demo for process conflict handle Loaded: loaded (/usr/lib/systemd/system/copy.service; static; vendor preset: disabled) Drop-In: /usr/lib/systemd/system/copy.service.d └─app.conf Active: inactive (dead) Docs: man:systemd.unit(8) May 10 17:31:03 lianhua systemd[1]: Starting a test copy demo for process conflict handle... May 10 17:31:23 lianhua systemd[1]: Started a test copy demo for process conflict handle.
标签:指令 vendor disable bsp ice conflict 根据 time 拷贝
原文地址:https://www.cnblogs.com/xingzheanan/p/12864323.html