{"id":958,"date":"2015-02-16T09:49:56","date_gmt":"2015-02-16T07:49:56","guid":{"rendered":"\/\/www.mcgill.org.za\/stuff\/?p=958"},"modified":"2015-02-16T10:07:05","modified_gmt":"2015-02-16T08:07:05","slug":"computer-insomnia","status":"publish","type":"post","link":"https:\/\/www.mcgill.org.za\/stuff\/archives\/958","title":{"rendered":"Computer insomnia"},"content":{"rendered":"<p>I updated my Ubuntu system installation on a laptop.\u00a0 This went fine.\u00a0 I installed more memory.\u00a0 This went well.\u00a0 But on the second day, I discovered that my laptop had insomnia.\u00a0 It could not sleep.\u00a0 Close the lid?\u00a0 It&#8217;s still on.\u00a0 Laptops that won&#8217;t sleep do not travel well.<\/p>\n<p>To cut a long story short (by not telling the long bits), neither the upgrade nor the additional memory caused the trouble, but a file left by the crummy &#8220;Validity Sensors&#8221; fingerprint scanner software did.\u00a0 Mind you, it didn&#8217;t work, so I should have removed it, but instead I forgot about it.\u00a0 Don&#8217;t buy Hewlett Packard laptops, as they use the USB device 138a:003d Validity Sensors, Inc. which is unsupported, except for this faulty binary-only software, which causes systems not to sleep.<\/p>\n<p>The thing that gave it away after many days of trying to figure it out was these entries in <em>\/var\/log\/pm-suspend.log<\/em>:<\/p>\n<pre>\/etc\/pm\/sleep.d\/ValidityServiceSuspend.sh suspend suspend: Returned exit code 1.\r\nRunning hook \/usr\/lib\/pm-utils\/sleep.d\/65ValidityServiceResume.sh resume suspend\r\n<\/pre>\n<p>The crummy HP\/VFS sensors software added a file <em>\/etc\/pm\/sleep.d\/ValidityServiceSuspend.sh<\/em> that said:<\/p>\n<pre>#!\/bin\/bash\r\n\r\n. \/usr\/lib\/pm-utils\/functions\r\n\r\nsuspend_FPS() {\r\n    # Signal the vcsFPService about the suspend\/hiberante\r\n\techo \" Sending Suspend Event\"\r\n\tpkill -SIGUSR1 vcsFPService\r\n}\r\n\r\ncase \"$1\" in\r\n\thibernate|suspend)\r\n\t\tsuspend_FPS\r\n\t\t;;\r\n\t*)\r\n\t\t;;\r\nesac\r\n\r\nexit $?<\/pre>\n<p>This code only works correctly when the <em>vcsFPService<\/em> is running. When it&#8217;s not running, then <em>pkill <\/em>returns an error, and <em>exit $? <\/em>passes it back up the chain (just like simply exiting the script would do &#8211; the fact that <em>exit $?<\/em> is always unnecessary at the end of a script, and yet is present, is an indication about the quality of this code).\u00a0 The program says &#8220;do not sleep unless you stop the fingerprint reader!&#8221;<\/p>\n<p>So in summary, my computer <em>couldn&#8217;t<\/em> kill something, and it couldn&#8217;t sleep as a result.<\/p>\n<blockquote><p><span id=\"en-ESV-16507\" class=\"text Prov-4-16\">For they cannot sleep unless they have done wrong;<\/span><br \/>\n<span class=\"indent-1\"><span class=\"indent-1-breaks\">\u00a0\u00a0\u00a0\u00a0<\/span><span class=\"text Prov-4-16\">they are robbed of sleep unless they have made someone stumble.<\/span><\/span><\/p><\/blockquote>\n<p>The fix was something like:<\/p>\n<pre>sed -i 's\/exit $?\/exit 0\/' \\\r\n    \/etc\/pm\/sleep.d\/ValidityServiceSuspend.sh \\\r\n    \/usr\/lib\/pm-utils\/sleep.d\/65ValidityServiceResume.sh<\/pre>\n<p>Being unsupported software, I can&#8217;t have it fixed. I am reduced to whining.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I updated my Ubuntu system installation on a laptop.\u00a0 This went fine.\u00a0 I installed more memory.\u00a0 This went well.\u00a0 But on the second day, I discovered that my laptop had insomnia.\u00a0 It could not sleep.\u00a0 Close the lid?\u00a0 It&#8217;s still &hellip; <a href=\"https:\/\/www.mcgill.org.za\/stuff\/archives\/958\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[37,173,17,174,166,190,11,51,175],"class_list":["post-958","post","type-post","status-publish","format-standard","hentry","category-stuff","tag-linux","tag-pm-suspend","tag-rants","tag-sleep","tag-software-2","tag-stuff","tag-stupidity","tag-ubuntu","tag-validity"],"_links":{"self":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/958","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/comments?post=958"}],"version-history":[{"count":4,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/958\/revisions"}],"predecessor-version":[{"id":962,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/958\/revisions\/962"}],"wp:attachment":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/media?parent=958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/categories?post=958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/tags?post=958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}