in reply to Regular expressions

You are making the assumption that all the output you see when you run "ipsec restart" from a console comes from a single process.

My (very limited) understanding of strongSwan is that it uses a "starter" process which forks out a thread to do the actual work.

I think you are capturing the output of the "starter" process, and missing the actual ipsec messages.

You can confirm my theory by examining the console messages after running your program - if you see the "Starting strongSwan" on the cosole, it means that your code did not capture it.

        "You're only given one little spark of madness. You mustn't lose it."         - Robin Williams