LoginSignup
3
4

More than 5 years have passed since last update.

Ubuntu 16.04にLeapMotion導入

Posted at

ちょっとめんどくさかったのでメモ

問題

公式からもろもろをダウンロードして,debパッケージをインストールした.

$ cd PATH_TO_DOWNLOADED_FOLDER  
$ sudo dpkg -i Leap-2.3.1+31549-x64.deb

が,このとき自分の環境が下のようなエラーが出た.

Leap Motion installed under /usr/bin and /usr/sbin
Failed to start leapd.service: Unit leapd.service not found.
dpkg: パッケージ leap の処理中にエラーが発生しました (--install):
 サブプロセス インストール済みの post-installation スクリプト はエラー終了ステータス 5 を返しました
ureadahead (0.100.0-19) のトリガを処理しています ...
処理中にエラーが発生しました:
 leap

READMEをみてるとOn Ubuntu the Leap Daemon should already be running.と書いているので,LeapMotion挿したらdaemonが走ってほしいが,
$ LeapControlPanelで確認しても,Leapが実行されていない.
(=LeapControlPanelのアイコンが緑になってくれない.Leap見ても赤外線でてない.でも緑ランプはついているので,電源は入っている状態.)

$ sudo leapdすればLeapMotionが実行されるが,daemonで動かそうと$ sudo service leapd startしても動かない.

方針

まぁインストールしたときのエラーでFailed to start leapd.service: Unit leapd.service not found.と言われているので,作ってやる.

手順

  1. serviceファイルを作る

    $ cd /lib/systemd/system
    $ sudo gedit leapd.service
    
  2. 出てきたエディタで,下をコピペ

    [Unit]
    Description=LeapMotion Daemon
    After=syslog.target
    
    [Service]
    Type=simple
    ExecStart=/usr/sbin/leapd
    
    [Install]
    WantedBy=multi-user.target
    
  3. リンクを貼って,認識させる

    $ sudo ln -s /lib/systemd/system/leapd.service /etc/systemd/system/leapd.service
    $ systemctl daemon-reload
    

これで,$ sudo service leapd startすればdaemonで動くようになる.

# 自動で起動はしないが,そこはあきらめました...
# /etc/initにleapd.confがあるので動いてくれるんでないの...??

参考

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4