why does hook_menu produce a menu that belongs to the system module? In my project we implement a little menu that provides information about the module.  This snippet lives in drutexml.module.

function drutexml_menu() {
  $items['drutexml'] = array(
    'title' =&gt; 'LaTeX filter implemented via LaTeXML',
    'page callback' =&gt; 'drutexml_information',
    'access callback' =&gt; TRUE,
  );
  return $items;
}


Actually this is a bit silly, and I want to turn it back off inside the installation profile.  But as it turns out...

SELECT link_path, module FROM menu_links WHERE link_path = "drutexml";

+-----------+--------+
| link_path | module |
+-----------+--------+
| drutexml  | system |
+-----------+--------+


and then in menu.inc, where menu_link_delete is implemented, we see this  bit of logic on line 2997:

if ($item &amp;&amp; ($item['module'] != 'system' || $item['updated'] || $force)) { ...


In other words, I can only delete non-"system" links.  That's fine with me!  Or it would be, if my link was stored with the name of the module where hook_menu is implemented in the first place.

What's going on here?  Why is this said to be a "system" link?
The only way to remove a menu item defined from a module in hook_menu() is, apart from removing its definition from the module's hook_menu(), removing it with hook_menu_alter().

function mymodule_menu_alter(&amp;$items) {
  unset($items['drutexml']); 
}


Menu items that are part of a menu, including the ones defined with hook_menu(), are saved in the menu_links table. Those defined in hook_menu() are saved setting the "module" field to "system" to distinguish them from other links directly added from a module.