Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Risolto] Creare script di shutdown/reboot
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Fri Oct 05, 2018 11:46 am    Post subject: [Risolto] Creare script di shutdown/reboot Reply with quote

Ciao a tutti, premetto che mi sto perdendo in un bicchiere d'acqua.
In pratica, vorrei scrivermi uno script da inserire in i3wm per spegnere/riavviare il laptop.

Arrivando da systemd di avevo:
Code:
systemctl poweroff
systemctl reboot


Da terminale dando
Code:
shutdown -t sec now

Sì spegne.

Ma qual'è l'esatto comando equivalente di systemd in openrc?


Last edited by zar Marco on Sun Oct 07, 2018 12:43 am; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30837
Location: here

PostPosted: Fri Oct 05, 2018 12:01 pm    Post subject: Reply with quote

Non dovrebbe esistere un comando equivalente in OpenRC, se hai bisogno usi i comando shutdown/halt/poweroff e restart (pacchetto sys-apps/sysvinit).
SystemD fa molto di piu' che semplicemente gestire i servizi.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Fri Oct 05, 2018 1:41 pm    Post subject: Reply with quote

Ah ok, quindi avrei bisogno di un pacchetto da installare.

Ma come mai shutdown da terminale funziona?

Ero convinto ci fosse un qualche servizio da attivare
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30837
Location: here

PostPosted: Fri Oct 05, 2018 1:49 pm    Post subject: Reply with quote

zar Marco wrote:
Ma come mai shutdown da terminale funziona?

Ero convinto ci fosse un qualche servizio da attivare

Ma tu intendi come mai non funziona da utente non privilegiato? Ora se lo fai da terminale lo fai con sudo o da root?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Fri Oct 05, 2018 3:49 pm    Post subject: Reply with quote

Funziona sia come utente Root che tramite sudo.
Più che altro mi stupisce che funzioni, avendo bisogno di un altro pacchetto. Ma probabilmente sto parlando di due cose diverse
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30837
Location: here

PostPosted: Fri Oct 05, 2018 4:46 pm    Post subject: Reply with quote

zar Marco wrote:
Funziona sia come utente Root che tramite sudo.
Più che altro mi stupisce che funzioni, avendo bisogno di un altro pacchetto. Ma probabilmente sto parlando di due cose diverse

No e' openrc che lo installa come dipendenza
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Fri Oct 05, 2018 4:48 pm    Post subject: Reply with quote

Ah ok, quindi dovrei averlo già. Devo solo capire come funziona eh eh
Back to top
View user's profile Send private message
xdarma
l33t
l33t


Joined: 08 Dec 2003
Posts: 719
Location: tra veneto e friuli (italy)

PostPosted: Fri Oct 05, 2018 5:10 pm    Post subject: Reply with quote

Se vuoi spegnere, dovrebbe essere:
Code:
/sbin/shutdown -h now


Per effettuare qualche azione particolare in fase di spegnimento (tipo fare il backup di qualche file particolarmente importante) puoi usare la directory /etc/local.d/
Nel file README trovi le istruzioni per creare gli script.
_________________
proud user of faKeDE-4.7.3 -> back to windowmaker -> moved to LXQt
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Fri Oct 05, 2018 5:30 pm    Post subject: Reply with quote

Grazie mille, domani provo subito a guardare dentro /sbin, così vedo di crearmi lo script

Secondo voi, questa vecchia discussione https://forums.gentoo.org/viewtopic-t-206349-start-25.html può essere ancora valida?
Back to top
View user's profile Send private message
zar Marco
Guru
Guru


Joined: 09 Sep 2016
Posts: 445
Location: Colle Umberto ( TV )

PostPosted: Sun Oct 07, 2018 12:42 am    Post subject: Reply with quote

Ottimo, posso dire di esserci riuscito, modificando alcune cose come in quel topic. Sono piccole grandi soddisfazioni eh eh
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum