Baculaのlogが出来ない!

 

カテゴリー: Baclua(バックアップ)に挑戦 | コメントする

baculaからメールが届かない

新規にbaculaでバックアップサーバーを立ち上げ運用を開始、でもバックアップ結果のメールが届かない。Thunderbird には

said: 504 5.5.2 <root@localhost>: Sender address
    rejected: need fully-qualified address (in reply to RCPT TO command)

とある。
送信者はMAILER-DAEMON@backup7.inpac.jpとなっていて
相手先はroot@localhost
になっている。だからこのエラーが出る。
bacula-dir.conf のMessages { (2ヶ所ある)

mail = root@localhost.inpac.jp = all, !skipped # 設定しておくとJob実行後にメールが来ます。
operator = root@localhost.inpac.jp = mount
mail = root@localhost.inpac.jp = all, !skipped (これは別のMessages { にある )

に変更し
# systemctl restart bacula-dir
で再起動、テストでバックアップすると無事メールが届くようになった。

カテゴリー: Baclua(バックアップ)に挑戦 | コメントする

bacula-dirがスタートしない

ある時、バックアップが進んでいないので調べると、bacula-dir.conf の pool { にある Maximum Volumes = 250 になっており、これらすべてを使い切っていたのが問題だった、ので Maximum Volumes = 400 に変更し(もちろんstrageの容量は余っている)
# systemctl restart bacula-dir
としたが、コマンドプロンプトに帰って来ないのでctrl+c でインターラプト。directer は動いていない。原因がなかなか判らない。google先生に聞いても的確な答えが見つからない。
結論:bacula-fd, bacula-sd などをリスタートしてから bacula-dir をスターとする事。bacula-sdだけのリスタートでもいいのかも?

カテゴリー: Baclua(バックアップ)に挑戦 | コメントする

携帯でマイナンバーカードが読み取れない

マイナポータルから、マイナンバーカードが健康保険証として使う登録が出来ているか確認しようと、ログインする際、マイナンバーカードを携帯で読み取る必要があるが、どうしても読み取れない。

原因:金属製の天板の机に置いていたのが原因、手で携帯とカードを近づけるとあっさり読んだ。カードを読み取る時は木製、ガラス等の上に置く事、金属製なら、厚めの本などを置いて読み取る事

カテゴリー: その他 | コメントする

LVMでWARNINGが消えない時


サブホストのバックアップサーバーにあるバックアップ用の2TBのSSDがお亡くなりなった。(メーカーは Fanxiang)なので、SSDを買い、一通りの設定が終わり、サーバーは正常に戻ったが、lvscanでエラーが出る
# lvscan
前略
WARNING: Couldn’t find device with uuid vsZVRp-k7ZT-LnIB-ERqo-Quab-jLVL-wlJI1r.
WARNING: Couldn’t find device with uuid 7SSlBe-KJ2r-bDyZ-DVz7-mUKU-wTxf-W9wq5c.
WARNING: VG Restore7 is missing PV vsZVRp-k7ZT-LnIB-ERqo-Quab-jLVL-wlJI1r (last written to [unknown]).
WARNING: VG Restore7 is missing PV 7SSlBe-KJ2r-bDyZ-DVz7-mUKU-wTxf-W9wq5c (last written to /dev/sdd5).
後略
これは死んだSSDの記録が残っている為だ。(本来はSSDを外す前に lvremove 等をやらないといけないが、忘れた)なので、これを消す
# vgreduce –removemissing Restore7  最後はVG名、ハイフォンは二つだよ
前略
Wrote out consistent volume group Restore7.
と表示され、lvscanでエラーが出なくなった。

後日談:壊れた(と思った)2TBのSSDを後日、まったく別のホストに付けると何と正常に動作した!! 以前のホストで再起動やらをやってもダメ出し、xfs_repair だとディスクはビジーだと言われ、補修できなかったんだけど。暑さのせい??

 

カテゴリー: その他 | コメントする

どうしてもデーターベースに保存できないカラムがある

これには随分手を焼いた。
原因は cotrollerにある
def tour_params
 params.require(:tour).permit(
  :s_no, :ref_no, :inp_icg, :agt_code, :agt_name, :agt_icg, :arr, :dep,
  :night, :flight, :htl_code, :tour, :no_pax,:meal, :pax_type, :rooming, :book_date,   :unit_price,
  :usd_total, :tts, :jpy_ttl, :net, :received, :invoice_date,:name, :room_type,   :remarks, :conf_no,
  :look, :jtb_ac, :course_no, :cancel_flag, :xxl_date
 )
end
カンマとセミコロン(, ;)の間にあるスペースが全角のスペースになっている所が有った。すべて半角スペースにすると解決した。
なので他にも有る可能性が有るので全角スペースをチェックする事にした。まずはripgrepをインストールする
$ sudo dnf install ripgrep
で、railsのhomeに行き
$ rg -n –pcre2 ‘\x{3000}’
これで全角スペースがある所を表示してくれる
app/views/agents/index.html.erb
5:<h1>Agents     <%= link_to “New agent”, new_agent_path %></h1>
など、私はAgentsと New agentの間を開けたかったので、わざと全角スペースをいれてある(半角だと一つしか入れてくれない)

 

カテゴリー: Rails 初心者の犯したエラー | コメントする

undefined method `total_pages’ for nil:NilClass

gemでkaminariを追記し、bundleなどを行い設定を入れたが、どうしても上のエラーが出る。随分設定を見直したが原因が分からず。
原因:index.html.erbの最後に記入した <%= paginate @hotels %> のホテルの所が大文字の @Hotels になっていた。これも初歩的ミス!

未だに、railsの設定ヨリも規約、のこの規約が理解出来ていない。
hotel hotels Hotel Hotels @hotels @hotel これらの違いをしっかり理解せねば!

カテゴリー: Rails 初心者の犯したエラー | コメントする

Gem もろもろ

* インストールされているか調べる
$ bunde list |grep  調べたいgem

* gemを削除する
$ bundle exec gem uninstall 削除したいgem

カテゴリー: Ruby on railsに挑戦(almalinux9) | コメントする

13:WEBサーバーをapacheにする

現時点ではdevelopment modeだが、production mode ではapacheを使うつもりだ。ただ作っているアプリのカラムが30以上もあり、WEBの表示を画面全体で見たいので、先にapacheで見れるようにするために gemのpassengerを入れて、apacheで表示出きるようにする。(注:railsアプリの公開は社内だけにし、テレワークの社員はVPNで社内ネットワークに入り、ローカルIPアドレス:3000でアクセス出来るようにするので、暗号化はしていない)まずはGemfile にpassengerを入れる
[fuji@rails8 TourData]$ gedit Gemfile
前略
# gem “image_processing”, “~> 1.2”
gem “spring-commands-rspec”
gem “passenger”     ← これを追記

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem “debug”, platforms: %i[ mri windows ], require: “debug/prelude”
後略
で、お決まりの
[fuji@rails8 TourData]$ bundle
apacheにpassengerをインストールするがその前にhomeデレクトリーを第三者が実行出来るようにしておく。
[fuji@rails8 TourData]$ chmod o+x/home/fuji
[fuji@rails8 TourData]$ passenger-install-apache2-modules


This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.

Here's what you can expect from the installation process:

 1. The Apache 2 module will be installed for you.
 2. You'll learn how to configure Apache.
 3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort. Enterをオス
Which languages are you interested in?

Use <space> to select.
If the menu doesn't display correctly, press '!'

 ‣ ⬢  Ruby     Rubyに三角が付いているのを確認後 Enter
   ⬡  Python
   ⬢  Node.js

色々足りないものが表示されたが記録が無くなっているので、何が不足していたかは思い出せないが、ともかくyum install …….などと言ってくれるのでその通りにインストールし、再度
[fuji@rails8 TourData]$ passenger-install-apache2-modules
で、最後の方で
Almost there!
Please edit your Apache configuration file, and add these lines:

LoadModule passenger_module /home/fuji/.rbenv/versions/3.2.9/lib/ruby/gems/3.2.0/gems/passenger-6.0.27/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
 PassengerRoot /home/fuji/.rbenv/versions/3.2.9/lib/ruby/gems/3.2.0/gems/passenger-6.0.27
 PassengerDefaultRuby /home/fuji/.rbenv/versions/3.2.9/bin/ruby
</IfModule>

After you restart Apache, you are ready to deploy any number of web
applications on Apache, with a minimum amount of configuration!

Press ENTER when you are done editing.

——————————————–
Validating installation…
* Checking whether this Passenger install is in PATH… ✓
* Checking whether there are no other Passenger installations… ✓
* Checking whether Apache is installed… ✓
* Checking whether the Passenger module is correctly configured in Apache… (!)

You did not specify ‘LoadModule passenger_module’ in any of your Apache
configuration files. Please paste the configuration snippet that this
installer printed earlier, into one of your Apache configuration files, such
as /etc/httpd/conf/httpd.conf.

Detected 0 error(s), 1 warning(s).
Press ENTER to continue.

——————————————–
Deploying a web application

To learn how to deploy a web app on Passenger, please follow the deployment
guide:

https://www.phusionpassenger.com/library/deploy/apache/deploy/

Enjoy Phusion Passenger, a product of Phusion® (www.phusion.nl) 🙂
https://www.phusionpassenger.com

Passenger® is a registered trademark of Asynchronous B.V.

Checking whether the Passenger module is correctly configured in Apache… (!) だけがエラーになっている。当たり前だ、インストールしただけなので設定は終わっていない。
まずはpassenger module をロードするがこれは
[root@rails8 ~]# gedit /etc/httpd/conf.modules.d/00-rails.conf
LoadModule passenger_module /home/fuji/.rbenv/versions/3.2.9/lib/ruby/gems/3.2.0/gems/passenger-6.0.27/buildout/apache2/mod_passenger.so
PassengerEnabled on
<IfModule mod_passenger.c>
 PassengerRoot /home/fuji/.rbenv/versions/3.2.9/lib/ruby/gems/3.2.0/gems/passenger-6.0.27
 PassengerDefaultRuby /home/fuji/.rbenv/versions/3.2.9/bin/ruby
</IfModule>
と設定を新規に作った。次はdocument rootなどの設定だが、これは新規に
[root@rails8 ~]# gedit /etc/httpd/conf.d/rails.conf
DocumentRoot “/Rails/TourData/public”

<Directory “/Rails/TourData/public”>
 AllowOverride None
 # Allow open access:
 Require all granted
</Directory>
そしてapacheを再起動
[root@rails8 ~]# systemctl restart httpd
[root@rails8 ~]# systemctl status httpd
で起動を確認
次にpassengerの起動
[fuji@rails8 TourData]$ passenger start –environment development
でpassengerはスタートしたが、その端末に
Started GET “/metrics” for 127.0.0.1 at 2025-08-30 16:49:25 +0900
ActionController::RoutingError (No route matches [GET] “/metrics”):
でもブラウザで http://IP アドレス:3000にアクセスするとapacheでアクセス出来る

カテゴリー: Ruby on railsに挑戦(almalinux9) | コメントする

12:ツアーデーターを作る

先走って、ログインから作ったが、本当はこっちを先に作るべきだった。
[fuji@rails8 TourData]$ rails g scaffold Tour ref_no:string conf_no:string agt_name:string look:string jtb_ac:string course_no:string flight:string arr:date dep:date hotel:string name:text no_pax:integer room_type:text meal:string night:integer remarks:text pax_type:string rooming:string unit_price:float usd_total:float tts_date:date tts:float jpy_ttl:integer net:float received:date book_date:date invoice_date:date s_no:integer inp_icg:string agt_code:string agt_icg:string htl_code:string
記入途中

カテゴリー: Ruby on railsに挑戦(almalinux9) | コメントする