当前位置:网站首页>/etc/rc. Local setting UI program startup and self startup
/etc/rc. Local setting UI program startup and self startup
2022-07-24 07:02:00 【lifei_ 0001】
And Windows Different ,Linux The desktop system of is just a software running on the kernel (Windows The desktop is integrated with the kernel ), It is no different from other software . The desktop software is opened when the user logs in with the desktop , therefore Linux Under the UI The program must open the account on the desktop to have permission to open .
Set up UI There are many scripts for program startup , For example, use in desktop settings desktop、 Write a self starting service by yourself 、 utilize Linux Scheduled tasks, etc , Here we discuss the use of /etc/rc.local The plan .
/etc/rc.local Script is the last script opened when the system starts , Permissions are root, If you want to start UI The program first needs to switch users .
For example, my current desktop login user is pi, Turn on UI The script of the program is start.sh.
stay rc.local Add su - pi -c 'echo "pi"|sudo /home/pi/start.sh'
su - pi -c ' command ': In the single quotation mark is the start script command ;
sudo /home/pi/start.sh :sudo Permission opening script ;
echo “pi” | : towards sudo Pass the password , The password is pi;
ps:UI The program must run on the display , So remember to set the displayed device location in the startup script . Generally, set environment variables “export DISPLAY=:0.0”.
边栏推荐
猜你喜欢

【学习笔记】网页出现白屏可能的原因与优化方法

Redis入门
![(note sorting is not completed) [graph theory: find the shortest path of single source]](/img/58/e61aea3c4d0a33d3615144763160f7.png)
(note sorting is not completed) [graph theory: find the shortest path of single source]

Requirements already satisfied: and read timed out. problem solving methods appear during the installation of snownlp package

sojson jsjiami.com. V6 crawler JS reverse

owasp top10 渗透测试

Three level classification / menu query tree structure
![[lvgl] API functions for setting, changing and deleting styles of components](/img/55/f25a510cf04caff7ee15e72360c3a1.png)
[lvgl] API functions for setting, changing and deleting styles of components

STM32基于hal库的adc以DMA的多通道采样以及所遇问题解决

STM32 external interrupt (register version)
随机推荐
一日一书:机器学习及实践——从零开始通往kaggle竞赛之路
Redis.conf详解
Redis 主从机制
tensorflow boolean_mask函数
mysql自动生成创建时间和更新时间
chm文件打开时提示乱码
STM32外部中断(寄存器版本)
Camera Hal OEM模块 ---- cmr_grab.c
You are you, and no one can replace you
【C语言】操作符详解(深入理解+整理归类)
PostgreSQL date handler usage
你就是你,没有人可以取代
[waveform / signal generator] Based on stc1524k32s4 for C on Keil
Redis basic type - ordered set Zset
String问题
[media controller] open source project learning notes (based on Arduino micro development board)
[learning notes] possible reasons and optimization methods for white screen on Web pages
Neural network superparameter adjustment (based on ray package)
Libc.so.6/glibc cross compilation
[lvgl] [stage summary 1]