Open sajjadsabzkar opened 2 months ago
I have done in this way. Look at a running system at /etc/init.d and /etc/systemd
Modify the lshw package or add a new for a net service
Create in /etc/init.d a service e.eg:
. dirname $0
/common
HOME=/etc/skel
case "$1" in init)
/bin/MyScript.sh
;; help) echo "Usage: $0 init" ;; *) exit 1 ;; esac
exit 0
Create a service definition under etc/systemd/system [Unit] Description=ThinStation MyDevices systemd unit After=profile-setup.service pkg.service ConditionPathIsReadWrite=/etc
[Service] Type=oneshot RemainAfterExit=yes EnvironmentFile=/etc/thinstation.env ExecStart=/etc/init.d/MyDevices init SyslogIdentifier=thinstation
[Install] WantedBy=multi-user.target
thanks. but when this system service not started
You will need to add a link in multi-user.target.wants that points to the service file you created.
Hi. I need to add a script for the lshw package and it will come up during boot and collect hardware information and put it inside the flash that has been burned. My first problem is how can I autostart my script as a session?