upstart

Switch between users in an upstart script

家住魔仙堡 提交于 2020-02-02 12:21:19
问题 Is it possible to have a upstart script that runs the pre-script as root but the rest as normal_user . I'm trying something like: setuid normal_user pre-start exec su -c "echo I'm root" root script exec /bin/bash <<"EOT" echo "haha, I'm normal user" EOT Is it necessary to drop setuid? 回答1: I finally got it working by removing setuid normal_user and change exec /bin/bash <<"EOT" to exec sudo -u normal_user /bin/bash <<"EOT" 回答2: In general, you will have to remove the setuid stanza so that

Switch between users in an upstart script

牧云@^-^@ 提交于 2020-02-02 12:15:07
问题 Is it possible to have a upstart script that runs the pre-script as root but the rest as normal_user . I'm trying something like: setuid normal_user pre-start exec su -c "echo I'm root" root script exec /bin/bash <<"EOT" echo "haha, I'm normal user" EOT Is it necessary to drop setuid? 回答1: I finally got it working by removing setuid normal_user and change exec /bin/bash <<"EOT" to exec sudo -u normal_user /bin/bash <<"EOT" 回答2: In general, you will have to remove the setuid stanza so that

Socket.io node.js hangs and monit not restarting the process

て烟熏妆下的殇ゞ 提交于 2020-01-15 12:44:28
问题 I have a node.js server (with socket.io) running using upstart and monit. My problem is my server becomes inaccessible (usually happens when im offline), and the monit is unable to restart the process. The server only reactivates or awakened if i login into the ftp using filezilla. This is my monit configuration: set logfile /var/log/monit.log check process mynode with pidfile /home/mylocation/pid/node-app.pid start program = "/etc/init.d/node-app start" uid nobody and gid nobody stop program

Socket.io node.js hangs and monit not restarting the process

老子叫甜甜 提交于 2020-01-15 12:44:27
问题 I have a node.js server (with socket.io) running using upstart and monit. My problem is my server becomes inaccessible (usually happens when im offline), and the monit is unable to restart the process. The server only reactivates or awakened if i login into the ftp using filezilla. This is my monit configuration: set logfile /var/log/monit.log check process mynode with pidfile /home/mylocation/pid/node-app.pid start program = "/etc/init.d/node-app start" uid nobody and gid nobody stop program

Fork processes indefinetly using gnu-parallel which catch individual exit errors and respawn

谁都会走 提交于 2020-01-15 06:50:33
问题 I guess the title gives you this thought. Another duplicate question Well, let me explain this in detail. Okay, here we go. I am using gearman to handle stack of tasks. I have a gearman client which send this task to workers. To run these task concurrently, there must be more workers to handle a task at a time. Presently, I create workers as per number of cpus. In my case, its 4 . So, 4 processes . ./worker & ./worker & ./worker & ./worker . I have same file running concurrently. But, I don't

Upstart calling script (for inserted USB-drive)

雨燕双飞 提交于 2020-01-11 18:32:20
问题 I know that Ubuntu (and Fedora) uses Upstart istead of the classical System V init daemon (SysVinit). I would like to know how to detect when a USB-drive has been inserted, mount it and copy some files to it. I would like Upstart to call my own script for this. If it is possible I would like Upstart to call the script for a specific USB-drive, so that I would get normal functionality for every USB-drive except my "instant backup" USB-drive. If Upstart could send the USB-drive identification

Can I import a Golang package based on the OS I'm building for?

你。 提交于 2020-01-01 16:08:09
问题 Say I have a go project that based on which OS, and in some cases which distro, I want to use say a Systemd client package vs an Upstart client package vs a sysv client package vs a launchd client package. Is it possible to selectively import each package so I only import the one I need per OS/distro I'm building for? Or do I have to import each package for each OS/distro? 回答1: Package build Build Constraints A build constraint, also known as a build tag, is a line comment that begins //

Can I import a Golang package based on the OS I'm building for?

会有一股神秘感。 提交于 2020-01-01 16:07:07
问题 Say I have a go project that based on which OS, and in some cases which distro, I want to use say a Systemd client package vs an Upstart client package vs a sysv client package vs a launchd client package. Is it possible to selectively import each package so I only import the one I need per OS/distro I'm building for? Or do I have to import each package for each OS/distro? 回答1: Package build Build Constraints A build constraint, also known as a build tag, is a line comment that begins //

Unicorn service upstart script throws “-su: bundle: command not found”

眉间皱痕 提交于 2020-01-01 14:36:09
问题 I recently created a VPS on DigitalOcean to host a rails app. I followed their guide to setup Unicorn with my application. https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-unicorn-and-nginx-on-ubuntu-14-04 A problem occurred when I ran sudo service unicorn_appxyz start . The error given was -su: bundle: command not found I traced the init.d script and pasted the evaluated server start up command in terminal and it works fine when executed under the user joe (the

Unicorn service upstart script throws “-su: bundle: command not found”

偶尔善良 提交于 2020-01-01 14:36:09
问题 I recently created a VPS on DigitalOcean to host a rails app. I followed their guide to setup Unicorn with my application. https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-unicorn-and-nginx-on-ubuntu-14-04 A problem occurred when I ran sudo service unicorn_appxyz start . The error given was -su: bundle: command not found I traced the init.d script and pasted the evaluated server start up command in terminal and it works fine when executed under the user joe (the