» »

systemctl zagon programa

systemctl zagon programa

korenje3 ::

A kdo ve zakaj mi ne zažene skripte?
Kako bi lahko videl tist blob data oz. kako lahko debug startam nek program s systemctl?

skripta:
#!/bin/sh
#/etc/init.d/homeautomation

export PATH=$PATH:/usr/bin
export NODE_PATH=$NODE_PATH:/usr/lib/node_modules

case "$1" in
  start)
  cd /homeautomation
  exec /usr/bin/forever start --sourceDir=/homeautomation -m 5 --minUptime 5000 --spinSleepTime 5000 -l /homeautomation/forever.log -o /homeautomation/foreverout.log -e /homeautomation/forevererr.log BBB.js
  ;;
stop)
  exec /usr/bin/forever stop --sourceDir=/homeautomation BBB.js
  ;;
*)
  echo "Usage: /etc/init.d/homeautomation {start|stop}"
  exit 1
  ;;
esac

exit 0


zagon systemctl:
root@beaglebone:/etc/init.d# systemctl status homeautomation
homeautomation.service - Run the home automation script
          Loaded: loaded (/lib/systemd/system/homeautomation.service; enabled)
          Active: failed (Result: exit-code) since Thu 2015-06-04 20:56:40 CEST; 30min ago
         Process: 2884 ExecStart=/etc/init.d/homeautomation start (code=exited, status=255)
          CGroup: name=systemd:/system/homeautomation.service

Jun 04 20:56:36 beaglebone systemd[1]: Starting Run the home automation script...
Jun 04 20:56:36 beaglebone systemd[1]: Started Run the home automation script.
Jun 04 20:56:40 beaglebone homeautomation[2884]: [60B blob data]
Jun 04 20:56:40 beaglebone homeautomation[2884]: [39B blob data]
Jun 04 20:56:40 beaglebone homeautomation[2884]: [108B blob data]
Jun 04 20:56:40 beaglebone systemd[1]: homeautomation.service: main process exited, code=exited, status=255/n/a
Jun 04 20:56:40 beaglebone systemd[1]: Unit homeautomation.service entered failed state
i9-12900k; 32GB DDR5-6000 CL36; Nvidia RTX 3080 ti;
Gigabyte Aorus z690 master; Be Quiet Dark Power 12 1000W

GTX970 ::

Kateri distro ?

korenje3 ::

angstrom linux-
i9-12900k; 32GB DDR5-6000 CL36; Nvidia RTX 3080 ti;
Gigabyte Aorus z690 master; Be Quiet Dark Power 12 1000W

hojnikb ::

kaj fura ta linux systemd al init.d ?

Ker je videt v fajlu init.d direktorij, a furaš systemctl, ki je del systemd.

Also, ima skripta taprave pravice ?
#https://bit.ly/3dFRi5L Treasure Cloud +10GB za oba
MediaBox: AMD R5 1600 AF, 16GB DDR4, 256GB SSD, B450M-DS3H, W10
PiNAS: RPI4 4GB, 20TB HDD

korenje3 ::

hm sem dal verbose messages v forever in dobim tole:

Jun 04 21:47:38 beaglebone homeautomation[3156]: info:    Forever processing file: BBB.js
Jun 04 21:47:38 beaglebone homeautomation[3156]: fs.js:338
Jun 04 21:47:38 beaglebone homeautomation[3156]: return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
Jun 04 21:47:38 beaglebone homeautomation[3156]: ^
Jun 04 21:47:38 beaglebone homeautomation[3156]: Error: ENOENT, no such file or directory '/root/.forever/IHyh.log'
Jun 04 21:47:38 beaglebone homeautomation[3156]: at Object.fs.openSync (fs.js:338:18)
Jun 04 21:47:38 beaglebone homeautomation[3156]: at Object.forever.startDaemon (/usr/lib/node_modules/forever/lib/forever.js:406:14)
Jun 04 21:47:38 beaglebone homeautomation[3156]: at app.cmd.cli.startDaemon (/usr/lib/node_modules/forever/lib/forever/cli.js:257:13)
Jun 04 21:47:38 beaglebone homeautomation[3156]: at /usr/lib/node_modules/forever/lib/forever/cli.js:144:5
Jun 04 21:47:38 beaglebone homeautomation[3156]: at forever.stat (/usr/lib/node_modules/forever/lib/forever.js:358:11)
Jun 04 21:47:38 beaglebone homeautomation[3156]: at Object.oncomplete (fs.js:297:15)
Jun 04 21:47:38 beaglebone systemd[1]: homeautomation.service: main process exited, code=exited, status=1/FAILURE
Jun 04 21:47:38 beaglebone systemd[1]: Unit homeautomation.service entered failed state


ni mi jasno zakaj hoče logirat v /root/.forever ko ima pa arngstrom root direktorij v /home/root.
i9-12900k; 32GB DDR5-6000 CL36; Nvidia RTX 3080 ti;
Gigabyte Aorus z690 master; Be Quiet Dark Power 12 1000W

Zgodovina sprememb…

  • spremenil: korenje3 ()

korenje3 ::

Sem odstranil forever, ker je očitno buggan. Environment fajl sem moral dodati, da mi je našlo node skripte.

[Service]
Type=simple
WorkingDirectory=/homeautomation
User=root
EnvironmentFile=/etc/sysconfig/homeautomation
ExecStart=/usr/bin/node BBB.js
i9-12900k; 32GB DDR5-6000 CL36; Nvidia RTX 3080 ti;
Gigabyte Aorus z690 master; Be Quiet Dark Power 12 1000W


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

Dnsmasq problem

Oddelek: Omrežja in internet
13789 (416) BlaY0
»

dnsmasq problem

Oddelek: Omrežja in internet
121429 (1169) poweroff
»

Zaznavanje Arduina priklopljenega preko USB v Linuxu

Oddelek: Programiranje
211285 (779) mojster_joni
»

problem pri sprembi root gesla v MySQL v Ubuntu

Oddelek: Pomoč in nasveti
231041 (621) killa bee
»

[Ubuntu] Samba

Oddelek: Programska oprema
151521 (1311) black ice

Več podobnih tem