LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-27-2014, 08:30 PM   #1
nsic
LQ Newbie
 
Registered: Aug 2005
Location: cebu,phillippines
Posts: 11

Rep: Reputation: 0
close open tty


hi

i have a created a service in Fedora 19 with following data inside

[Unit]
Description=Autologin Service
Before=getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service

[Service]
Type=Simple
ExecStart=/usr/sbin/mingetty --autologin root --loginprog=/usr/bin/startx.autologin --noclear tty7 38400

Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target


my problem is when I stop the service the open tty7 is still open. I want it to be inaccessible when i stop the service.

Last edited by nsic; 02-27-2014 at 08:34 PM.
 
Old 02-28-2014, 01:11 AM   #2
nsic
LQ Newbie
 
Registered: Aug 2005
Location: cebu,phillippines
Posts: 11

Original Poster
Rep: Reputation: 0
I have done a work around on this



/sbin/agetty --noclear tty7 38400 linux &
PID=`ps -ax | grep tty7 | grep agetty | awk '{print $1}'`
kill -9 $PID
deallocvt 7
 
Old 02-28-2014, 02:32 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,923

Rep: Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319
that is a single pkill command (like this):
pkill -9 -f 'agetty.*tty7'
but you should try it with pkill -15 or pkill -2 instead of -9
 
  


Reply

Tags
fedora 19, service, systemd, tty



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Language Prob on Login and TTY Close Screens bbradley1946 Slackware 0 05-22-2012 03:35 PM
[SOLVED] tty is closed without calling close(?) johst Programming 1 02-18-2011 02:37 AM
How to make a SSH persist after tty close.. assasukasse Linux - Software 3 07-01-2010 11:36 AM
tty driver open and close functions mayank_linux Linux - Networking 0 06-21-2006 07:45 AM
open() failed on /dev/tty ekko37 Linux - Software 7 01-15-2005 02:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration