Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

510
Views
pantalla No se puede abrir su terminal '/dev/pts/0' - verifique

Quiero iniciar un programa en una pantalla como usuario "XYZ" con un script. Este es mi script en forma abreviada:

 # replace <newuser> with the user you wish to run teamspeak 3 with. USER="teamspeak" # Do not change this path PATH=/bin:/usr/bin:/sbin:/usr/sbin # The path to the teamspeak 3 server/scripts . example = /home/teamspeak3/teamspeak3-server DIR=/home/teamspeak/voiceserver/teamspeak3 DAEMON=$DIR/ts3server_startscript.sh # Change all PARAMS to your needs. I required the ini so teamspeak used MySQL PARAMS="inifile=ts3server.ini" #Name = The screen will be named from this. NAME=teamspeak3 DESC="Teamspeak Server 3" case "$1" in start) echo "Starting $DESC" script -q -c "su $USER -l -c \"screen -m -d -S $NAME $DAEMON start\"" /dev/null ;; stop) su $USER -l -c "screen -S $NAME -X quit " echo " ... done. $DESC Stopped." ;; restart) su $USER -l -c "screen -S $NAME -X quit " echo " Closed Process, Restarting" script -q -c "su $USER -l -c \"screen -m -d -S $NAME $DAEMON start\"" /dev/null echo " ... done. $DESC Restarted" ;; status) # Check whether there's a "Team Speak 3" process ps aux | grep -v grep | grep ts3server_ > /dev/null CHECK=$? [ $CHECK -eq 0 ] && echo "$DESC is UP" || echo "$DESC is DOWN" ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac exit 0

Quiero conectarme en la pantalla, pero obtuve esto.

 Cannot open your terminal '/dev/pts/0' - please check.

¿Hice algo mal?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Esto sucede porque es posible que haya hecho un sudo su user_name y luego haya activado el comando de pantalla.

Hay 2 formas de arreglar esto.

  1. Inicie sesión directamente en "user_name" a través de ssh.
  2. Tome posesión del shell escribiendo script /dev/null como usuario user_name y luego escriba screen
over 4 years ago · Santiago Trujillo Report

0

Para resolver el problema, intente ejecutar el script /dev/null como el usuario al que su antes de iniciar screen .

 script -q -c "su $USER -l -c \"screen -m -d -S $NAME $DAEMON start\"" /dev/null

Más sobre esto:

  • https://serverfault.com/questions/116775/sudo-como-diferente-usuario-y-pantalla-en-ejecución/116830
over 4 years ago · Santiago Trujillo Report

0

Inspirado por ambas respuestas respaldadas aquí, agregué la siguiente función a mi .bashrc :

 sscreen(){ script -q -c "screen $*" /dev/null; }

Ahora solo uso sscreen en lugar de screen y nunca más tengo que volver a pensar en el problema.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!