3 ms·
C is certainly out of place here as is any compiled let alone system programming language.
by nuclx 9y ago
C is certainly out of place here as is any compiled let alone system programming language.
- zzzcpan 9y agoIf you want to make a program that runs another program, i.e. forkexecs a process, how would you do it? You would want to drop privileges before exec, set resource limits, maybe chroot, maybe even seccomp, maybe pass sockets created in a privileged parent process, watch SIGCHLD in case it dies to restart it or start some sort of failover procedure, maybe also read its logs from stdout/stderr and do something with them. And what if you want to monitor a remote process like that and start it on another node if it stops responding? Would you use Bash for all of that? Perl - sure, but you would still have to write an extension in C to handle all of the OS specific things. I wouldn't use Go for that as it's going to be too much work, but its static binaries make it attractive for at least some of the infrastructural things.
- nuclx 9y agopython works fine for the more generic tasks like spawning subprocesses, parsing stdout/stderr, though the code can get a bit verbose when compared to bash scripts. Concerning the more OS specific bits and pieces, it really depends on what you count towards DevOps. In the article it is defined by the mantra "The infrastructure is configured, deployed, and managed through code". I would really hope you don't have to write a line of C code to achieve that. If you're developing tools for the DevOps space this is a different story of course.