Skip to content

Instantly share code, notes, and snippets.

@greenbreakfast
Last active May 29, 2018 02:37
Show Gist options
  • Save greenbreakfast/59fed49cd58151c6c009b48817feaff8 to your computer and use it in GitHub Desktop.
Save greenbreakfast/59fed49cd58151c6c009b48817feaff8 to your computer and use it in GitHub Desktop.
Example Omega2 /etc/init.d service script
#!/bin/sh /etc/rc.common
# Copyright (C) 2018 Onion Corporation
START=90
USE_PROCD=1
start_service() {
procd_open_instance
procd_set_param command [YOUR COMMAND HERE]
# procd_append_param command [COMMAND ARGUMENTS] # optionally append command parameters
procd_set_param respawn # respawn the service if it exits
# procd_set_param stdout 1 # forward stdout of the command to logd
# procd_set_param stderr 1 # same for stderr
procd_close_instance
}
#!/bin/sh /etc/rc.common
# Copyright (C) 2018 Onion Corporation
START=90
USE_PROCD=1
start_service() {
procd_open_instance
procd_set_param command /root/gpioIrq
procd_append_param command 0 # optionally append command parameters - this program takes the GPIO number as an argument
procd_set_param respawn # respawn the service if it exits
procd_set_param stdout 1 # forward stdout of the command to logd
procd_set_param stderr 1 # same for stderr
procd_close_instance
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment