php.iniを変更せずにdisable_functionsの内容を無効化してroundcubeのアップグレードスクリプトを動作させる方法

/etc/php.iniでdisable_functionsに「system」を含めている場合、roundcubeのアップグレードを行う時に「./bin/installto.sh /var/www/roundcube」を実行すると、エラーとなってしまう。

# ./bin/installto.sh /var/www/roundcubemail
Error 500: PHP system() function is required. Check disable_functions in php.ini.
#

これは、/etc/php.ini内の「disable_functions 」設定で「system」が記載されていることにより使用できないために発生している。

/etc/php.iniの disable_functionsを修正してしまえば動くようになりますが、アップデートのたびに変更して、アップデートが終わったら元に戻すのは面倒です。

/etc/php.iniを変更するのではなく、一時的に回避するための手法を検討した結果・・・

「php -d disable_functions=”” ./bin/installto.sh /var/www/roundcubemail」と実行することで、disable_functionsの設定に関して無視して実行することができました。

# php -d disable_functions="" ./bin/installto.sh /var/www/roundcubemail
<略>

これで、/etc/php.iniを編集しなくともアップデートができるようになりました。

+メッセージで使われるRCSと旧来のSMS/MMSの使い分け

NTTドコモ, au, ソフトバンクが共通で画像添付のメッセージをやりとりできるサービスを+メッセージとして開始する、というリリースが出た。

これは、GSMAという団体が定義しているRich Communication Services(RCS)という仕様に基づいたもので、すでにAndroidはGoogleが使えるソフト(メッセージ)を出しているし、iOSもiMessageが対応しているにもかかわらず、別のソフトで対応する方針らしい。

なんでだろう?と調べて見ると、日本ならではの事情らしきものが見えた。

まず、携帯電話同士のメッセージのやりとりには、短い文章のみを送れるSMSと、画像などを添付して送れるMMSの2種類がある。
これらはパケット課金ではなく、1通いくら、という形でやりとりされている。
日本では、SMSは3社とも対応しているが、MMSは一部しか対応していない。

RCSの仕様書を読んでいくと、おもしろいことが分かった。
それは、「メッセージの送信者と受信者の状況」と「オフライン受信の可否」と「ファイルを添付するか否か」によって、SMS,RCS,MMSを自動選択する、という仕組みがある、ということである。

joyn Crane Product Definition Document Version 3.0
(この記事は上記のRCS実装の1つであるjoynを元に書いていたが、その後、RCS Universal Profileに関するドキュメントも公開された→「RCS Universal Profile Service Definition Document Version 2.2」若干記述が変わっているところがあるものの概ね同じです)

なお、pdfは「RCS Documentation」にて[Specifications]→[Universal Profile Service]でダウンロードすることができます。

さて、仕様書からSMS,RCS,MMSの送受信の動作に関して表で説明されている箇所を抜き出して見ると・・・

その1:オフライン受信を許可しない設定時にメッセージのみを送る場合

その2:オフライン受信を許可する設定時にメッセージのみを送る場合

その3:オフライン受信を許可しない設定時にファイル添付でメッセージを送る場合

その4:オフライン受信を許可する設定時にファイル添付でメッセージを送る場合

ちょっとした条件の違いで何を使うかが変わっている。

これを日本でそのまま使ってしまうと、パケット課金のRCSで送ろうと思ったけど、実はSMSやMMSで送られちゃいました、ということが起こりえる。
そうすると1通当たりの課金になってしまうため、たくさんメッセージを送るとすごいことになってしまう。

こういった課金事故を減らすために必ずRCSでメッセージを送信するような仕組みにしたソフトを使わせようとしているのではないか?

という印象を受けた

HPE OfficeConnect 1950スイッチをシリアルケーブルで設定できるのか?

HPE OfficeConnect 1950はマニュアルを読む限り設定はWebでしかできないように書かれている。
しかし、設定をExportしたファイルを見ると、HPE 5800と同様のフォーマットで設定が書かれている。
本当にシリアルで設定ができないのか?

まず、シリアルは38400bpsで接続する。

初期は「admin」で、パスワードは無い。

******************************************************************************
* Copyright (c) 2010-2017 Hewlett Packard Enterprise Development LP          *
* Without the owner's prior written consent,                                 *
* no decompiling or reverse-engineering shall be allowed.                    *
******************************************************************************

Line aux0 is available.


Press ENTER to get started.
login: admin
Password:
<HPE>%Mar 19 13:31:25:657 2018 HPE SHELL/5/SHELL_LOGIN: admin logged in from aux0.

「?」を入力すると、いま使えるコマンド一覧が出てくる。

<HPE> ?
User view commands:
  display       Display current system information
  exit          Alias for 'quit'
  initialize    Delete the startup configuration file and reboot system
  ipsetup       IP configuration
  no            Alias for 'undo'
  password      Specify password of local user
  ping          Ping function
  poe           Power over Ethernet
  quit          Exit from current command view
  reboot        Reboot operation
  show          Alias for 'display'
  summary       Display summary information of the device
  telnet        Establish a telnet connection
  transceiver   Enable transceiver phony alarm
  undo          Cancel current setting
  upgrade       Upgrade the system boot file or the Boot ROM program
  xtd-cli-mode  Switch to extended CLI mode to display and execute all commands
                (special authorization required)

<HPE>

Web GUIでエクスポートした設定はHPE 5800相当なのに、使えるコマンドは全然違う。

とりあえず片っ端から入力してみれば、最後の「xtd-cli-mode」が怪しそう。

<HPE>xtd-cli-mode
All commands can be displayed and executed in extended CLI mode. Switch to extended CLI mode? [Y/N]:y
Password:


パスワードを要求される。

調べてみると、パスワードがわかる。

Glazenbakje’s technical blog「HP v1910 Secret Commando list ( how to enable it )」のコメントに記載
俺の技術メモ「HP 1950 Switchのxtd-cli-modeパスワード
HPE Community「HP 1950 JG961A “xtd-cli-mode”

foes-bent-pile-atom-ship

<HPE>xtd-cli-mode
All commands can be displayed and executed in extended CLI mode. Switch to extended CLI mode? [Y/N]:y
Password:
Warning: Extended CLI mode is intended for developers to test the system. Before using commands in extended CLI mode, contact the Technical Support and make sure you know the potential impact on the device and the network.
<HPE>

プロンプトが変わる、ということもないため、変更が反映されたかがわかりません。
とりあえず「?」と入力し、コマンド一覧を出します。

<HPE>?
User view commands:
  archive             Archive configuration
  arp                 Address Resolution Protocol (ARP) module
  backup              Backup operation
  boot-loader         Software image file management
  bootrom             Update/read/backup/restore bootrom
  cd                  Change current directory
  cfd                 Connectivity Fault Detection (CFD) module
  clock               Specify the system clock
  copy                Copy a file
  debugging           Enable system debugging functions
  delete              Delete a file
  diagnostic-logfile  Diagnostic log file configuration
  dir                 Display files and directories on the storage media
  display             Display current system information
  erase               Alias for 'delete'
  exception           Exception information configuration
  exit                Alias for 'quit'
  fdisk               Partition a storage medium
  fixdisk             Check and repair a storage medium
  format              Format a storage medium
  free                Release a connection
  ftp                 Open an FTP connection
  gunzip              Decompress file
  gzip                Compress file
  install             Perform package management operation
  ip                  Specify IP configuration
  local-guest         Manage guest users
  lock                Lock the current line
  logfile             Log file configuration
  md5sum              Compute the hash digest of a file using the MD5 algorithm
  mkdir               Create a new directory
  monitor             System monitor
  more                Display the contents of a file
  mount               Mount a storage medium
  move                Move a file
  mtrace              Configure the multicast traceroute
  no                  Alias for 'undo'
  oam                 OAM module
  ping                Ping function
  process             Process management
  pwd                 Display current working directory
  python              Source using python script
  quit                Exit from current command view
  reboot              Reboot operation
  rename              Rename a file or directory
  repeat              Repeat executing history commands
  reset               Reset operation
  restore             Restore operation
  rmdir               Remove an existing directory
  save                Save current configuration
  scheduler           Scheduler configuration
  scp                 Establish an SCP connection to an SCP server
  screen-length       Multiple-screen output function
  security-logfile    Security log file configuration
  send                Send information to other lines
  sftp                Establish an SFTP connection to an SFTP server
  sha256sum           Compute the hash digest of a file using the SHA256
                      algorithm
  show                Alias for 'display'
  ssh2                Establish an Stelnet connection to an Stelnet server
  startup             Specify system startup parameters
  super               Switch to a user role
  system-view         Enter the System View
  tar                 Archive management
  tclquit             Exit from TCL shell
  tclsh               Enter the TCL shell
  telnet              Establish a telnet connection
  terminal            Set the terminal line characteristics
  tftp                Open a TFTP connection
  tracert             Tracert function
  umount              Unmount a storage medium
  undelete            Recover a deleted file
  undo                Cancel current setting
  web                 Web configuration
  write               Alias for 'save'
  xml                 Enter XML view
  xtd-cli-mode        Switch to extended CLI mode to display and execute all
                      commands (special authorization required)

<HPE>

大幅に増えました。

「show current-configuration」で現在の設定を確認できます。

<HPE> show current-configuration
#
 version 7.1.070, Release 5106p03
#
 sysname HPE
#
 clock timezone Tokyo add 09:00:00
 clock protocol ntp
#
 telnet server enable
<略>
#
user-group system
#
local-user admin class manage
 service-type telnet http https terminal
 authorization-attribute user-role network-admin
 authorization-attribute user-role network-operator
#
 ip http enable
 ip https enable
#
return
<HPE>

この結果は、Web GUIでエクスポートした設定ファイルと等しい状態でした。

UEFIブートのサーバでWindows Server 2016のインストール用USBメモリが起動しない

hpeのProLiantサーバにWindows Server 2016をインストールする場合、通常はIntelligent Provisioning を使う。

しかし、Administratorパスワードが不明な場合、Windows Server 2016の標準ISOイメージのレスキューモードで起動することになるのだが、Smart Array B140i用のドライバが含まれていないため、内蔵ディスクが見えない。

対処するためにはISOイメージ内のsources\boot.wim にDSIMコマンドを使ってAdd-driverすることになる。

手順は「Windows インストールメディアにドライバーを追加する」にあるものをほぼそのまま使い、下記の様に実施した。

カスタマイズしたWindows Server 2016ISOイメージの作り方

1. 作業用Windows10を用意
2. Windows ADK 1709の「Deployment Tools」と「Windows Preinstallation Environment (Windows PE)」をインストール
3. メニューの登録されている「展開およびイメージング ツール環境」を選択してコマンドプロンプトを起動
4. 「copype amd64 c:\work\pe_x64」(今回、C:\work を作業用ディレクトリとした)でWindows PE環境を展開
5. C:\work\iso にWindows Server 2016 ISOの中身をコピー
6. マウント用ディレクトリ c:\work\offline を作成
7. 「dism /get-imageInfo /imagefile:”C:\work\iso\sources\boot.wim”」でインデックス番号を確認
 インデックス1とインデックス2があることを確認
 レスキューの際にどちらを使うかわからないので、とりあえず両方使う

8. まずインデックス1をc:\work\offlineにマウント
「dism /mount-image /imagefile:”C:\work\iso\sources\boot.wim” /index:1 /mountdir:”C:\work\offline”」

9. smart array b140i用のドライバをc:\work\hpedriver に展開

10. ドライバを追加。複数ある場合も考慮して、/recurseオプション付きで実行
「dism /add-driver /image:”c:\work\offline” /driver:”c:\work\hpedriver” /recurse」

11. ドライバが追加されたことを確認
「dism /get-drivers /image:”c:\work\offline”」

12. アンマウントする
「dism /unmount-image /mountdir:”c:\work\offline” /commit」

13. 今度はインデックス2に対して実行
「dism /mount-image /imagefile:”C:\work\iso\sources\boot.wim” /index:2 /mountdir:”C:\work\offline”」

14. ドライバを追加。複数ある場合も考慮して、/recurseオプション付きで実行
「dism /add-driver /image:”c:\work\offline” /driver:”c:\work\hpedriver” /recurse」

15. ドライバが追加されたことを確認
「dism /get-drivers /image:”c:\work\offline”」

16. アンマウントする
「dism /unmount-image /mountdir:”c:\work\offline” /commit」

17. oscdimgコマンドを実行してISOイメージの作成
「oscdimg -m -o -u2 -udfver102 -bootdata:2#p0,e,bc:\work\PE_x64\fwfiles\etfsboot.com#pEF,e,bc:\work\PE_x64\fwfiles\efisys.bin c:\work\iso c:\work\win2016-new.iso」

(2025/2/5追記 Windows Sevrer 2022向けでADK 10.1.26100.2454 実施したところfwfilesからbootbinsに変更されていました「oscdimg -m -o -u2 -udfver102 -bootdata:2#p0,e,bc:\work\PE_x64\bootbins\etfsboot.com#pEF,e,bc:\work\PE_x64\bootbins\efisys.bin c:\work\iso c:\work\win2022-new.iso」

これで、作成したISOイメージをFAT32でフォーマットしたUSBメモリにコピーしようとしたところ、install.wimのコピーで失敗した。

原因はinstall.wimのサイズがFAT32制限である4GB以上の約6GBであるためです。

NTFSもしくはexFATでフォーマットしなおしたところ、コピーはできたものの、サーバ側で起動ディスクとして認識せず、起動できなかった。

確認したところ、 UEFIの場合、ファイルシステムがFAT32であること、という前提があった。 この制限については、マイクロソフトの「起動可能な USB フラッシュ ドライブを作成します。」に記載がされている。

サーバー プラットフォームが Unified Extensible Firmware Interface (UEFI) をサポートする場合は、NTFS ではなく FAT32 として、USB フラッシュ ドライブをフォーマットする必要があります。 フォーマットするパーティションを FAT32 として、次のように入力します。 format fs=fat32 quick、し、[入力] をクリックします。

ブート可能な USB フラッシュ ドライブの作成

この記事を書くきっかけとなった件ではiLO Advancedライセンスがあったため、isoイメージをiLOからマウントすることで、DVDを作成する必要はなく対応することができた。

しかし、USBメモリを使ってWindows Server 2016のインストールを行う手法があるかどうか
つまりは4GBを超えてしまったinstall.wimをダイエットすることができるのか、分割することはできるのか、という点は不明なままであった・・・


2018/03/13追記

Microsoftの公式記述を発見した。

手法1「WinPE: Store or split images to deploy Windows using a single USB drive
 USBメモリにパーテーションを2つ作り、FAT32のメイン領域と、NTFSのinstall.wimのみをおく領域を作る、というもの

手法2「Split a Windows image file (.wim) to span across multiple DVDs
Dism /Split-Imageコマンドを使ってinstall.wimをinstall.swmに分割するというもの

Dism /Split-Image /ImageFile:C:\work\iso\sources\install.wim /SWMFile:C:\work\iso\sources\install.swm /FileSize:4000

(上記ページだと4700となっているけど、4GB超えてて大丈夫なの?と心配なので余裕をもって)

2020/12/21 追記

これを再度hpe dl360 gen10環境で実施する必要があったので確認した。

(1) FAT32フォーマットのUSBドライブ(Eドライブにマウント)にISOの中身(Dドライブにマウント)を全部コピーするも install.wim のみエラー
(2) コマンドプロンプト開いて「 dism /split-image /imagefile:d:\sources\install.wim /swmfile:e:\sources\install.swm /filesize:4000」を実行
(3) e:\sources\ にinstall.swm とinstall2.swm ができていることを確認
(4) できたUSBメモリで起動

KaiOS搭載のJioPhoneの型番がよくわかんない件

Firefox OSの派生とも言えるKaiOSを搭載しているというJioPhone

調べて見ると、youtubeにキーロックされたものをリカバリーモードで起動してファクトリーリセットする、というやつが大量に出てくるんだけど、型番がたくさんあって謎過ぎる・・・

JioPhone F30C

JioPhone F81E

JioPhone LF-2403N

JioPhone F61f

JioPhone F90M

JioPhone F101K