Viewing a response to: @steemed/become-a-steem-witness-essentials
Using Ubuntu's Upstart to Make Steem a Service ======== This post is an addendum to the essentials document and describes how to use Ubuntu's [upstart](http://upstart.ubuntu.com/) to make Steem a startup service with minimal fail protection (to restart the service if the process dies or server reboots). Modifying and Installing The Steem Upstart Script ================================================= The full script is provided at the bottom of this post. Save it as "steem.conf". The service will be called "steem". You will want to change several parts of this script to fit your setup: * Change the "author" and email. * Change the "chdir" line to the path of your Steem working directory (one directory higher than witness_data_dir). * Change the "exec" line to point to your steemd daemon. Once you have edited the script, copy it as sudoer to the /etc/init directory: sudo cp steem.conf /etc/init/steem.conf Starting the Steem Service ========================== The easiest way to start the Steem service (and test your config at the same time) is to simply reboot your computer. It is recommended to go ahead and reboot because you will want to test that the steem service starts on reboot anyway. I reboot like this: sudo reboot If you don't wish to reboot, you can do the simple command (ensuring first that all other instances of steemd are stopped) sudo start steem You can verify that the steem service is running with this command: ps aux | grep steemd Which will give something similar to the following output: ima@ubuntu:~$ ps aux | grep steemd root 966 0.5 3.5 607992 141480 ? Ssl 09:07 4:06 /root/steemd --rpc-endpoint Testing the Service =================== The first test should have been when you rebooted to start the steem service. Let's assume that you your ps output included the line: root 966 0.5 3.5 607992 141480 ? Ssl 09:07 4:06 /root/steemd --rpc-endpoint This means that steemd is running as process 966. Let's kill that process and see if the steem service bounces back. The way to kill process 966 is with this command: sudo kill 966 Here is my output of the full process. Yours should look similar. ima@ubuntu:~$ ps aux | grep steemd root 966 0.5 3.5 607992 141736 ? Ssl 09:07 4:08 /root/steemd --rpc-endpoint ima 3130 0.0 0.0 11744 924 pts/1 S+ 21:22 0:00 grep --color=auto steemd ima@ubuntu:~$ sudo kill 966 ima@ubuntu:~$ ps aux | grep steemd root 3132 0.0 0.3 137676 12268 ? Rsl 21:22 0:00 /root/steemd --rpc-endpoint ima 3136 0.0 0.0 11740 932 pts/1 S+ 21:22 0:00 grep --color=auto steemd It looks like success. The steemd daemon respawned as process 3132 within seconds of the kill. You may be wondering what the "ima" lines are in the ps output. Those are simply the grep processes I used to filter the full ps output. Steem Service Upstart Script ============================ # steemservice - steem daemon service for witness description "Steem" author "Ima Witness <ima@imawitness.net>" # Stanzas # # Stanzas control when and how a process is started and stopped # See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas # When to start the service start on runlevel [2345] # When to stop the service stop on runlevel [016] # Automatically restart process if crashed respawn # Essentially lets upstart know the process will detach itself to the background # This option does not seem to be of great importance, so it does not need to be set. #expect fork # Specify working directory chdir /path/to/steem/working/dir # Specify the process/command to start, e.g. exec /path/to/steem/daemon/steemd --rpc-endpoint 2>>debug.log 1>error.log
author | steemed |
---|---|
permlink | use-ubuntu-upstart-for-steem-service |
category | steemhelp |
json_metadata | "" |
created | 2016-04-23 21:56:21 |
last_update | 2016-04-23 21:58:36 |
depth | 1 |
children | 5 |
last_payout | 2016-08-24 21:32:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 497.754 HBD |
curator_payout_value | 497.719 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 3,910 |
author_reputation | 23,215,872,177,290 |
root_title | "Essential Guide to Becoming a Steem Witness" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 669 |
net_rshares | 109,710,191,962,442 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
itsascam | 0 | 13,377,761,631,600 | 100% | ||
berniesanders | 0 | 30,606,108,000,000 | 100% | ||
dan | 0 | 47,756,400,000,000 | 100% | ||
steemroller | 0 | 2,139,158,994,000 | 100% | ||
steemed | 0 | 13,319,577,869,932 | 100% | ||
nextgenwitness | 0 | 264,109,000,000 | 100% | ||
justin | 0 | 721,163,000,000 | 100% | ||
complexring | 0 | 537,148,187,713 | 100% | ||
aizensou | 0 | 5,299,570,000 | 100% | ||
steempower | 0 | 53,511,411,072 | 100% | ||
pfunk | 0 | 112,610,130,742 | 100% | ||
esteem | 0 | 1,100,306,507 | 100% | ||
proctologic | 0 | 22,461,742,882 | 100% | ||
steempowered | 0 | 143,035,693 | 100% | ||
orwell | 0 | 1,366,897,225 | 100% | ||
aaaaa | 0 | 1,768,300,683 | 100% | ||
top | 0 | 1,238,375,167 | 100% | ||
zero | 0 | 507,027,993 | 100% | ||
fractalnode | 0 | 0 | 100% | ||
daowisp | 0 | 19,044,960,106 | 100% | ||
noaommerrr | 0 | 177,002,690,191 | 100% | ||
nuno-nutcrusherz | 0 | 493,798,763 | 100% | ||
hipster | 0 | 572,773,291,229 | 100% | ||
klye | 0 | 0 | 100% | ||
murh | 0 | 2,443,935,843 | 33.01% | ||
uaufund | 0 | 5,667,270,679 | 100% | ||
matt-a | 0 | 0 | 100% | ||
wenden | 0 | 243,484,857 | 100% | ||
kaptainkrayola | 0 | 10,047,424,372 | 100% | ||
bycz | 0 | 288,052,103 | 100% | ||
eliteturbo | 0 | 383,805,835 | 100% | ||
baryonlee | 0 | 316,344,538 | 100% | ||
abiky | 0 | 0 | 100% | ||
someguy123 | 0 | 53,422,717 | 100% | ||
mckenziegary | 0 | 0 | 100% | ||
sflaherty | 0 | 0 | 100% | ||
arkadiy | 0 | 0 | 100% | ||
happyface | 0 | 0 | 100% | ||
mulletwang | 0 | 0 | 100% | ||
karemmohsen | 0 | 0 | 100% | ||
funnyquotes | 0 | 0 | 100% | ||
traffer | 0 | 0 | 100% | ||
troywilliams | 0 | 0 | 100% | ||
harpreetmaan | 0 | 0 | 100% | ||
draco1 | 0 | 0 | 100% | ||
amosinfo | 0 | 0 | 100% | ||
unrol | 0 | 0 | 100% | ||
devkapoor423 | 0 | 0 | 100% |
interesting article could go in later, i need time and some good hardware first thanks!
author | angelblouz |
---|---|
permlink | re-steemed-use-ubuntu-upstart-for-steem-service-20171225t023716210z |
category | steemhelp |
json_metadata | {"tags":["steemhelp"],"app":"steemit/0.1"} |
created | 2017-12-25 02:38:06 |
last_update | 2017-12-25 02:38:06 |
depth | 2 |
children | 0 |
last_payout | 2018-01-01 02:38:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 88 |
author_reputation | 34,905,385,134 |
root_title | "Essential Guide to Becoming a Steem Witness" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 25,103,799 |
net_rshares | 1,148,899,068 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
angelblouz | 0 | 1,148,899,068 | 0% |
why the hash rate so low in upstart mode? 1hps! 782782ms th_a witness.cpp:429 on_applied_block ] hash rate: 1 hps
author | baryonlee |
---|---|
permlink | re-steemed-use-ubuntu-upstart-for-steem-service-20160822t071852355z |
category | steemhelp |
json_metadata | {"tags":["steemhelp"]} |
created | 2016-08-22 07:18:51 |
last_update | 2016-08-22 07:18:51 |
depth | 2 |
children | 0 |
last_payout | 2016-08-24 21:32:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 138 |
author_reputation | 144,042,539,115 |
root_title | "Essential Guide to Becoming a Steem Witness" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 931,043 |
net_rshares | 0 |
Great guide! I used [steemychicken1's guide](https://steemit.com/witness-category/@steemychicken1/-iptables-simple-configuration) to block all ports except 22 on my witness node. This had the unintended effect of blocking the port that upstart listened on. A quick scan using ```netstat``` allowed me to see that upstart was listening on port 8769. Using the same commands for the guide linked above, I unblocked port 8769 and everything worked. Thank you!
author | complexring |
---|---|
permlink | re-steemed-use-ubuntu-upstart-for-steem-service-20160426t012601820z |
category | steemhelp |
json_metadata | {} |
created | 2016-04-26 01:25:39 |
last_update | 2016-04-26 01:25:39 |
depth | 2 |
children | 0 |
last_payout | 2016-08-24 21:32:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 462 |
author_reputation | 62,649,292,215,598 |
root_title | "Essential Guide to Becoming a Steem Witness" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 830 |
net_rshares | 23,729,474 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
surf4life | 0 | 23,729,474 | 100% |
FYI, Ubuntu 16.x now uses systemd by default in place of upstart. - - - Permanent switch back to upstart Install the upstart-sysv package, which will remove ubuntu-standard and systemd-sysv (but should not remove anything else -- if it does, yell!), and run sudo update-initramfs -u. After that, grub's "Advanced options" menu will have a corresponding "Ubuntu, with Linux ... (systemd)" entry where you can do an one-time boot with systemd. If you want to switch back to systemd, install the systemd-sysv and ubuntu-standard packages. https://wiki.ubuntu.com/SystemdForUpstartUsers
author | daowisp |
---|---|
permlink | re-steemed-use-ubuntu-upstart-for-steem-service-20160815t022813974z |
category | steemhelp |
json_metadata | {"tags":["steemhelp"],"links":["https://wiki.ubuntu.com/SystemdForUpstartUsers"]} |
created | 2016-08-15 02:28:15 |
last_update | 2016-08-15 02:28:15 |
depth | 2 |
children | 0 |
last_payout | 2016-08-24 21:32:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 588 |
author_reputation | 2,750,638,235,966 |
root_title | "Essential Guide to Becoming a Steem Witness" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 809,835 |
net_rshares | 0 |
Thanks for sharing this, adding to my witness!
author | nextgenwitness |
---|---|
permlink | re-steemed-use-ubuntu-upstart-for-steem-service-20160424t041426566z |
category | steemhelp |
json_metadata | {} |
created | 2016-04-24 04:14:27 |
last_update | 2016-04-24 04:14:27 |
depth | 2 |
children | 0 |
last_payout | 2016-08-24 21:32:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 44.848 HBD |
curator_payout_value | 44.820 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 46 |
author_reputation | 9,326,993,992 |
root_title | "Essential Guide to Becoming a Steem Witness" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 693 |
net_rshares | 31,582,978,629,650 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
berniesanders | 0 | 30,005,989,000,000 | 100% | ||
nextgenwitness | 0 | 258,930,000,000 | 100% | ||
justin | 0 | 721,163,000,000 | 100% | ||
benjojo | 0 | 550,390,639,582 | 100% | ||
caesar | 0 | 2,793,992,164 | 100% | ||
donkeypong | 0 | 19,392,755,472 | 100% | ||
infowars.com | 0 | 66,163,433 | 100% | ||
venuspcs | 0 | 24,253,078,999 | 100% | ||
augur | 0 | 0 | 100% | ||
rossenpavlov | 0 | 0 | 100% |