Work with setsid to open a session and close it correctly


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Work with setsid to open a session and close it correctly
# 1  
Old 12-11-2016
Work with setsid to open a session and close it correctly

I would like to create the following script:
  • run a python script with setsid
  • python may or may not fail with exception
  • check if all of the group processes were terminated correctly
  • if not, kill the remaining processes

How can I do that?

Thanks a lot

Last edited by rbatte1; 12-12-2016 at 09:29 AM.. Reason: Converted to formatted list
# 2  
Old 12-12-2016
Any attempts/ideas/thoughts from your side?
# 3  
Old 12-12-2016
There is a fairly nice example of what you are trying to do here timeout.py.

It claims to work OK in POSIX and windows, captures stdout and stderror and preserves child return code.
# 4  
Old 12-13-2016
Welcome ASF Studio,

I have a few to questions pose in response first:-
  • Is this homework/assignment? There are specific forums for these.
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • Apart from Python, what are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.


Thanks, in advance,
Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get value from a close and open parenthesis?

Hi Gurus, I have an input like the one below. What i wanted to achieved is to create a select statement based from that information INPUTInsert into table_name (col1,col2,col3,col4,col5,DATE1,DATE2,col6,col7,col8,col9,col10,col11) values (6752,14932156,24,'ALL','Staff',to_date('04/17/2017... (6 Replies)
Discussion started by: ernesto
6 Replies

2. Shell Programming and Scripting

Why does this awk script not work correctly?

I have a large database with English on the left hand side and Indic words on the left hand. It so happens that since the Indic words have been entered by hand, there are duplicates in the entries. The structure is as under: English headword=Indic gloss,Indic gloss A small sample will... (6 Replies)
Discussion started by: gimley
6 Replies

3. Gentoo

LDAP-Auth does not work correctly with systemd

Hi, since the upgrade to Gnome 3.6 (now i have 3.8) the authentication over LDAP stops working. The whole machine does not start anymore. The machine boot, but no gdm and no X. I can login, with root, but then the tty hangs. When i look at ttyF12 i see a lot of systemd service the runs random,... (1 Reply)
Discussion started by: darktux
1 Replies

4. SCO

Set NIC correctly , but the network does not work

I'm trying to virtualize an instance of SCO Open Server 5.0.2c in VirtualBox (called VM- A) , I can not configure the network (NIC). The NIC I'm using is PCnet -FAST III (Am79C973 ) (this NIC works with VirtualBox + SCO 5.0.5M) When I add from ' Add new LAN adapter' I detects the NIC... (2 Replies)
Discussion started by: flako
2 Replies

5. UNIX for Advanced & Expert Users

Libvirt does not work correctly anymore on my gentoo

Hi, Since a year my libvirtd does not work anymore on my Gentoodesktop. In the meantime a used virtualbox. But I would like to have back libvirt. The problem was after libvirt should not only work with root privileges. I deinstalled all things with libvirt an kvm. I removed all things from /var... (4 Replies)
Discussion started by: darktux
4 Replies

6. IP Networking

Open/close of ports

Hi, I have read some forum theads about the open and close ports. some points are clear and it is not working on my machine or something am i missing? I have commented out a port /etc/services, one application uses then when i use the telnet <hostname> <port_blocked> it shows connected..... (1 Reply)
Discussion started by: balamv
1 Replies

7. Shell Programming and Scripting

Unable to close telnet session from script

Hello people, I am creating a script that will alert me in an ftp or telnet account on my system expires. FTP part is ok, but when I am entering the 3 script, it stucks. I can see that the script will not close the telnet seession. Can you please check and let me know what I am doing wrong? What if... (7 Replies)
Discussion started by: drbiloukos
7 Replies

8. Programming

Cannot get dbx to work correctly with a running process

Hi everyone, I've been struggling with this for a few weeks now. I'm trying to debug a running process with dbx on an AIX box. The command I'm using is 'dbx -a <pid> core' There is a function I can perform in my application that crashes this process, but it does not show up as crashed in... (0 Replies)
Discussion started by: ctote
0 Replies

9. UNIX for Dummies Questions & Answers

command to close telent session when login incorrect

i need a command to close telnet session wen login incorrect..i want to embed it into my perl script for telnet to check for login incorrect error. (2 Replies)
Discussion started by: raksha.s
2 Replies

10. SuSE

vsft doesn't work correctly

I install vsftpd server on 2 SUSE 10.2 servers. The first works perfectly, but the second doesn't work how I expect. The second works only over local network and doesn't over internet. The vsftpd.conf and ../xinetd.d/vsftpd are the same in 2 servers. The only different was when I threw to log in... (1 Reply)
Discussion started by: zhivko.neychev
1 Replies
Login or Register to Ask a Question