Redmine-4.1.1 解決:2個實例開機自啓動腳本只能啓動一個

前言

2周前安裝了雙實例,見: Redmine-4.1.1第二個實例(多實例)安裝記錄(Ubuntu20.04.2LTS) 但有一個遺留問題,個實例開機自啓動腳本只能啓動一個。解決了幾次,今天終於找到原因解決了。

 

問題描述

# samxiao @ rm411 in ~ [15:03:09]
$ cat auto-run-when-boot/xsz-boot.sh
#! /bin/bash
cd /home/samxiao/redmine-4.1.1-10086xsz
bundle exec rails server thin -e production -p 10086 -d
# bundle exec rails server thin -e production -p 10086 -l log/thin.log -d
systemctl status thin

# not plugins installed
# x:88(0x58)
cd /home/samxiao/redmine-4.1.1-no-plugins-installed-8801
bundle exec rails server thin -e production -p 8801 -d
systemctl status thin

bundle exec rails server thin -e production -p 10086 -d 這一個沒有啓動。

 

 

手動執行以列命令是可以啓動的

cd /home/samxiao/redmine-4.1.1-10086xsz
bundle exec rails server thin -e production -p 10086 -d

 

解決辦法:是插件CKEditor的Gemfile的問題, gem 'rich', path:'~/rich-1.5.2'必須使用絕對路徑

即將 ~/rich-1.5.2 改爲/home/samxiao/rich-1.5.2就行了

原因:系統啓動時還沒有登錄,實際是root用戶。

~/rich-1.5.2表示 /home/root/rich-1.5.2,沒有/home/root/rich-1.5.2這個目錄。
~/rich-1.5.2 是samxiao這個用戶安裝的, 在/home/samxiao/rich-1.5.2下。

發現問題的過程,執行sudo /etc/rc.local時發現提示The path/root/rich-1.5.2does not exist.

# samxiao @ rm411 in ~/auto-run-when-boot [9:52:39] 
$ sudo  /etc/rc.local
The path `/root/rich-1.5.2` does not exist.
13
# samxiao @ rm411 in ~/auto-run-when-boot [9:49:47] 
$ sudo /etc/rc.local                     
The path `/root/rich-1.5.2` does not exist.


# samxiao @ rm411 in ~/auto-run-when-boot [9:49:18] 
$ vi xsz-boot.sh         

# samxiao @ rm411 in ~/auto-run-when-boot [9:49:47] 
$ sudo /etc/rc.local                     
The path `/root/rich-1.5.2` does not exist.

# samxiao @ rm411 in ~/auto-run-when-boot [9:50:05] C:13
$ sudo  vi  /etc/rc.local

# samxiao @ rm411 in ~/auto-run-when-boot [9:50:32] C:1
$ l
total 16K
drwxrwxr-x  2 samxiao samxiao 4.0K Mar 23 09:49 .
drwxr-xr-x 23 samxiao samxiao 4.0K Mar 23 09:51 ..
-rwxrwxr-x  1 samxiao samxiao  351 Mar 23 09:49 xsz-boot.sh
-rw-r--r--  1 samxiao samxiao  966 Feb 19 17:22 xsz.service

# samxiao @ rm411 in ~/auto-run-when-boot [9:51:24] 
$ sudo  vi  /etc/rc.local

# samxiao @ rm411 in ~/auto-run-when-boot [9:52:31] 
$ cat  /etc/rc.local
#! /bin/bash

# cd /home/samxiao/redmine-4.1.1-10086xsz
# bundle exec rails server thin -e production -p 10086 -d
/home/samxiao/auto-run-when-boot/xsz-boot.sh



# samxiao @ rm411 in ~/auto-run-when-boot [9:52:39] 
$ sudo  /etc/rc.local
The path `/root/rich-1.5.2` does not exist.
13


# samxiao @ rm411 in ~/redmine-4.1.1-10086xsz [9:55:16] C:130
$ find . -name "Gemfile"| xargs -i -t  cat {} | grep "rich-1.5.2" 
cat ./plugins/redmine_dashboard/Gemfile 
cat ./plugins/redmine_serial_number_field/Gemfile 
cat ./plugins/redmine_more_previews/converters/cliff/Gemfile 
cat ./plugins/redmine_more_previews/converters/zippy/Gemfile 
cat ./plugins/redmine_more_previews/Gemfile 
cat ./plugins/additionals/Gemfile 
cat ./plugins/redmine_people/Gemfile 
cat ./plugins/redmine_dmsf/Gemfile 
cat ./plugins/redmine_knowledgebase/Gemfile 
cat ./plugins/custom_tables/Gemfile 
cat ./plugins/additional_tags/Gemfile 
cat ./plugins/redmine_questions/Gemfile 
cat ./plugins/redmine_ckeditor/Gemfile 
gem 'rich', path: '~/rich-1.5.2'
cat ./plugins/redmine_favorite_projects/Gemfile 
cat ./Gemfile 


 # source 'https://rubygems.org'
  2 
  3 # gem 'rich', git: 'https://github.com/a-ono/rich.git', tag: '1.5.2'
  4 gem 'rich', path: '~/rich-1.5.2'
  5 gem 'kaminari'
  6 gem 'htmlentities'
  7 gem 'paperclip', '~> 6.1.0'
  8 gem 'pandoc-ruby'
  9 
 10 # It is needed for upgrading CKEditor
 11 #gem 'sprockets-rails', '< 3.0.0'
 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章